I have a problem when using abstract classes to keep my code common to my tests, initialization, shutdown etc ... I use a concrete class just to initialize the variables. The inherited code of the abstract class does not run when running the tests, I believe some configuration is missing, an example code follows:
namespace meusTestes
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
public abstract class AbTest
{
public abstract string getString();
[Test]
public void SharedTest()
{
Assert.NotNull(getString()); //Don't execute
}
}
[TestFixture]
public class RealTest : AbTest
{
public override string getString()
{
return " "; //Don't execute
}
[Test]
public void InternalTest()
{
Assert.IsTrue(true); // Execute
}
}
}
The InternalTest test runs correctly, but the inherited (SharedTest) class of the abstract class does not, my doubt is why the inherited does not execute dodo as the documentation provides for inheritance testing.