I updated my reference for Microsoft.VisualStudio.QualityTools.UnitTestFramework
in a test project from 10 to 10.1 and the expected exception doesn't seem to do it's job anymore. Try this for example ...
[TestMethod]
[ExpectedException(typeof(FileNotFoundException))]
public void SanityTest()
{
File.ReadAllLines("TheresNoWayThisThingExists");
}
Test fails. If I revert back to 10 (have to undo), it passes. Anyone verify this or is it just me? I've tried it in resharper's test runner and ms test runner with the same result.
edit : additional info
It seems to know it passed ...sort of. Adding in a string value for 'noExceptionMessage' does NOT return that string value on failure.
Also AllowDerivedTypes seems to have no effect as well. (I swapped out FileNotFound to just Exception, same result)
xUnit test is the best Unit testing framework for . Net programming languages like C#, VB.Net, and F#. xUnit derives its structure and functionality from SUnit of Smalltalk.
MSTest is a number-one open-source test framework that is shipped along with the Visual Studio IDE. It is also referred to as the Unit Testing Framework. However, MSTest is the same within the developer community. MSTest is used to run tests.
Determine what you want to focus on before jumping into testing. Identify the highest-priority application features or areas that must be tested. Identify a list of scenarios within each feature to test, and to consider which level of testing can fulfill each.
There is a difference between vstest and mstest - the former is a test runner and the later is a test framework.
It happens when a project runtime version is v4.0.30319 and you change MSTest UnitTestingFramework from 10 to 10.1 which is v2.0.50727. There is no UnitTestingFramework 10.1 with runtime version v4.0.30319. So in order to fix it you need either change runtime version of the project or switch back to UnitTestingFramework 10.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With