I'm making a CUIT in Visual Studio 2013, making it Data-Driven using a CSV file.
the CSV file contains this:
Materiale, MaterialeTykkelse, Højde, Bredde, Dybde, KasseBæreevne, Diameter, Længde, RørBæreevne
Jern,15,10,20,10,"1940970,9",25,25,"12039935,17"
PVC (Plast),15,10,20,10,"1989662,4",25,25,"12231232,42"
Glas,15,10,20,10,"1981272,5",25,25,"12198270,44"
Træ,15,10,20,10,"100,2",25,25,"500,5"
An example TestMethod with a CSV DataSource bound
[DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", "|DataDirectory|\\data.csv", "data#csv", DataAccessMethod.Sequential), DeploymentItem("data.csv"), TestMethod]
public void TestMethod1()
{
// To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
ApplicationUnderTest.Launch(@"PathToExe", @"PathToExe");
this.UIMap.SelectMaterialParams.UIMaterialThickness = TestContext.DataRow[0].ToString();
this.UIMap.SelectMaterial();
this.UIMap.AssertResultExpectedValues.UITxtBoxResultatRoerEditText = TestContext.DataRow[8].ToString();
this.UIMap.AssertResult();
}
The first 3 iterations of the TestMethod works without problems, but once it gets to the fourth one, which contains a Danish letter "æ", it must fail to parse it properly since it cannot select the item in the ComboBox named "Træ".
I've tried hardcoding it to "Træ" and then it works fine, but it kind of defeats the point of datadriven then.
The CSV file is saved as Unicode (UTF-8 without signature) - Codepage 65001. I have tried with and without signature UTF8, without any effect.
The only possible solutions I've found around the net have been to implement a decoder manually, to handle the foreign letters. But i honestly don't believe that is the best way to do it.
Thanks in advance.
//Ronin