public void SetUp() { _uow = MockRepository.GenerateMock<IUnitOfWork>(); _insideBehavior = MockRepository.GenerateStub<IControllerActionBehavior>(); _behavior = new access_the_database_through_a_unit_of_work(_uow) {InsideBehavior = _insideBehavior}; _input = new TestInputModel(); _output = new TestOutputModel(); _actionFunc = i => new TestOutputModel(); }
public void by_model() { var model = new TestOutputModel(); urls.Stub(x => x.UrlFor(model)).Return("url1"); authorizor.Stub(x => x.IsAuthorized(model)).Return(true); ClassUnderTest.EndpointFor(model).ShouldEqual(new Endpoint { IsAuthorized = true, Url = "url1" }); }
public void by_model_and_category() { var model = new TestOutputModel(); var theCategory = "Category A"; urls.Stub(x => x.UrlFor(model, theCategory)).Return("url1"); authorizor.Stub(x => x.IsAuthorized(model, theCategory)).Return(true); ClassUnderTest.EndpointFor(model, theCategory).ShouldEqual(new Endpoint { IsAuthorized = true, Url = "url1" }); }