Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // basically just wrapping StructureMap's built-in automocking fun stuff
- public class SpecFor<TSubject> where TSubject : class
- {
- protected static TSubject sut { get { return mocker.ClassUnderTest; } }
- static RhinoAutoMocker<TSubject> mocker;
- protected SpecFor()
- {
- mocker = new RhinoAutoMocker<TSubject>();
- }
- protected static TDependency the_dependency<TDependency>() where TDependency : class
- {
- return mocker.Get<TDependency>();
- }
- protected static TStubbedType stub_for<TStubbedType>() where TStubbedType : class
- {
- return MockRepository.GenerateStub<TStubbedType>();
- }
- protected static void inject_dependency<TDependency>(TDependency dependency)
- {
- mocker.Inject(dependency);
- }
- }
Add Comment
Please, Sign In to add comment