views:

159

answers:

1

WHy is it not possible to inheritance tests from other assemblies to run:

namespace TestProject.Base
{
    [TestClass]   
    public abstract class TestBaseClass
    {
        [TestMethod]
        public void BaseTest()
        {
            Assert.IsTrue(false);
        }
    }
}

Test Runner

namespace TestProject.UnitTest
{   
    [TestClass]
    public class UnitTest : TestBaseClass
    {
    }
}

It is ONLY possible to do run the test when the classes are in the SAME assembly WTF!

Is it possible to have test inheritance like above with NUnit and be runnable?

A: 

You must reference the assembly containing the class you wish to inherit from.

This has nothing to do with the fact that you're trying to run a test. It's because of the way code is linked.

dss539
Assemblies are refernced. Otherwise you will get an compile error.