I have this abstract test class
[TestFixture]
public abstract class BaseTests
{
private IRepository _repository;
public BaseTests(IRepository repository)
{
_repository = repository;
}
[Test]
public virtual void CanGetResultsFromSearch()
{
var results = _repository.GetResults("test");
Assert.IsTrue(results.Count() > 0);
}
}
Is there any value in executing the Base Tests as part of Unit Testing and also Integration testings. e.g
[TestFixture]
public class UnitTest : BaseTests
{
private static IRepository _repository = new FakeReposistory();
public UnitTest() : base(_repository)
{
}
}
[TestFixture]
public class IntegrationTest : BaseTests
{
private static IRepository _repository = new SqlReposistory();
public UnitTest() : base(_repository)
{
}
}
Is there value in repeating the test twice? I am a bit unclear if this particular test is a concern of the integration test? i.e Should integration tests be testing public methods on a class? Or should it be more into testing the functionality of the system? Or Both?!