When creating a generic base test class in MSTest, and inheriting from it, I\'m unable to run the tests of all the inheriting classes.
Nothing special, but another way of solving the problem by calling base methods is:
public abstract class AccountBaseTest
{
protected abstract IAccountRepository GetAccountRepository();
public void _submitAccountToLMS_BlankAccount_NewLmsID()
{
Account account = new Account(GetAccountRepository());
account.FirstName = Faker.FirstName();
account.LastName = Faker.LastName();
account.SubmitToLms();
Assert.IsTrue(account.LmsID > 0);
}
}
[TestClass]
public class AccountIntegrationTest
{
protected override IAccountRepository GetAccountRepository()
{
return new AccountRepository();
}
[TestMethod]
public void SubmitAccountToLMS_BlankAccount_NewLmsID()
{
base._submitAccountToLMS_BlankAccount_NewLmsID();
}
}
Hopefully VS 2012 will fix this problem....