c# - ExpectedExceptionAttribute is not working in MSTest -
It is weird, but suddenly expected exception entry
not sure before leaving the job for me the other day Is it gone wrong I am running VS 2010 and VS 2005 Side-by-Side This VS Not working in 2010. This test should be passed, although it is failing:
[TestMethod] [Expected exception (type of argument)] Public Zero test_Exception () {New Dual NullException ("Test" ); }
Any ideas? It really suks.
Not to revive a dead thread, but when I did all this suddenly with me, It can help others I finally figured out what was the problem, which could be correlated with John, the expected expection feature appears to work only if the project is identified as TestProject ( Only one .NET assembly)
unload the project Switch to edit csproj file and check that following setting exists:
& gt; ProjectTypeGuids & gt; {3AC096D0-A1C2-E12C-1390-A8335801FDAB} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} & lt; / ProjectTypeGuids & gt;
Reload and rebuild the project (assuming the VS2010 project). Expected exception testing should now be passed.
On this issue, when we standardize MSTEST (TFS CI build thanks) from NUINT and found that after taking the place of asset, thanks to the & lt;> beautiful simplicity & amp; [Expected exception (type)] Flexibility with nonsense, (Not to mention losing [tests]!) Expected test failed for no reason.
It is not necessary to say that I am pushing to get NUIT back, after finding:
Comments
Post a Comment