NUnit vs MSTest

来源:互联网 发布:seo外包安徽 编辑:程序博客网 时间:2024/06/04 19:05

    In Nunit, tests are not executed in parallel.  Rather, it appears that all tests execute on a single thread. 
    In MSTest, each test is instantiated on a separate thread, this results the runs being interleaved.  Therefore, if test A depends on test B for its success, it likely will fail as test B will likely start running as test A is running.

    The time at which ClassCleanUp/TestFixtureTearDown executes is different between the two frameworks. 
In Nunit, TestFixtureTearDown is executed immediately following the completion of the last test in a TestFixture or after TearDown if the attribute exists for the test in question.  In the Whidbey implementation of MsTest, ClassCleanUp executes at the end of a test run, before AssemblyCleanUp but not necessarily immediately after the last test in a TestClass has completed executing.

    In Whidbey, support for test class inheritance was missing. 
    In Nunit, it is fully supported.  This will be rectified in Orcas.

    In MsTest, TestContext exists for passing information about the test run.  There is no equivalent in Nunit tests.  This can serve as a handy tool for pulling information from datasources on the disk to the unit tests, as well as other uses. 

原创粉丝点击