MSTest data driven rows are cast to ints

痞子三分冷 提交于 2019-12-13 06:20:28

问题


I have a data driven test (using MSTest) that has inputs that look like this:

ValuesToInput,ExpectedValue
0,0
00,00
000,000
0000,000
00000,000
000000,000

When I pull those out of my TestContext they are just 0. It has converted my string of 0000 to an int and gives me 0.

How can I make it give me my values as strings?

NOTE: My test method is setup like this:

[TestCategory("CodedUI"), DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", "MyCvsFile.csv", "MyCvsFile#csv", DataAccessMethod.Sequential), DeploymentItem("DataDriven\\MyCvsFile.csv"), TestMethod]
public void DoMyTest()
{
    // My Test Stuff here

}

来源:https://stackoverflow.com/questions/19014821/mstest-data-driven-rows-are-cast-to-ints

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!