What is the replacement for TestContext.DataRow[“MyColumnName”]

坚强是说给别人听的谎言 提交于 2019-12-04 03:01:21

Since moving to aspnet core, I've never been able to use the same [Datasource(...)] attribute to iterate through test data, my data-driven tests are always skipped.

Have you considered switching to another approach with [DataTestMethod] and [DynamicData] with a custom source that reads you file ?

Here's a good article on this :

https://www.meziantou.net/2018/02/05/mstest-v2-data-tests

Maybe another way would be to read the whole file at the begining of the test and then iterate through the dataset as One single unit test?

Hope this helps.

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