Skip to content

Instantly share code, notes, and snippets.

@JayBazuzi
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JayBazuzi/3122a1f93b2eb7596d93 to your computer and use it in GitHub Desktop.
Save JayBazuzi/3122a1f93b2eb7596d93 to your computer and use it in GitHub Desktop.
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