Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
abstract class AdapterTestsBase
{
public abstract IPort CreateSubject();
[TestMethod]
public void FShouldBlah()
{
IPort subject = CreateSubject();
int result = subject.F();
Assert.AreEqual(7, result);
}
// More tests here...
}
[TestClass]
class RealAdapterTests : AdapterTestsBase
{
public override IPort CreateSubject()
{
return new RealAdapter();
}
}
[TestClass]
class InMemoryAdapterTests : AdapterTestsBase
{
public override IPort CreateSubject()
{
return new InMemoryAdapter();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment