Skip to content

Instantly share code, notes, and snippets.

@KevM
Created November 12, 2009 21:26
Show Gist options
  • Save KevM/233289 to your computer and use it in GitHub Desktop.
Save KevM/233289 to your computer and use it in GitHub Desktop.
public abstract class Context<T> where T : class
{
[SetUp]
public void Setup()
{
_services = new RhinoAutoMocker<T>(MockMode.AAA);
OverrideMocks();
_cut = _services.ClassUnderTest;
Given();
}
public RhinoAutoMocker<T> _services { get; private set; }
public T _cut { get; private set; }
public SERVICE MockFor<SERVICE>() where SERVICE : class
{
return _services.Get<SERVICE>();
}
public SERVICE Override<SERVICE>(SERVICE with) where SERVICE : class
{
_services.Inject(with);
return with;
}
public virtual void Given()
{
}
public virtual void OverrideMocks()
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment