简体   繁体   中英

Unit Tests Fail when “Run All” in Visual Studio but passes individually

I am having this wierd problem with MOQ Unit tests.

I have around 636 unit tests written using MOQ Framework in VS 2012. When I run them project-wise and/or individually, they pass successfully. but whenever I select Run-All they fail randomly showing different errors.

Most of the methods show IO.FileNotFoundException.

I looked Here here and here but no clue yet.

Edited :

I solved the problem of FileNotFoundException using DeploymentItem [] attribute.

But still one of the project is failing when RunAll. exception tells - " Cannot convert, incompatible types " on of the properties.

seems like I missed using DeploymentItem["NeededProject.dll"] for each unit test class. Its working fine now. :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM