public void Setup() { basketRepository = MockRepository.GenerateStub<IRepository<Basket>>(); unitOfWorkManager = MockRepository.GenerateStub<IUnitOfWorkManager>(); userService = MockRepository.GenerateStub<IUserService>(); postageService = MockRepository.GenerateStub<IPostageService>(); countryRepository = MockRepository.GenerateStub<IRepository<Country>>(); cardTypeRepository = MockRepository.GenerateStub<IRepository<CardType>>(); orderRepository = MockRepository.GenerateStub<IRepository<Order>>(); subscriptionRepository = MockRepository.GenerateStub<IRepository<MailingListSubscription>>(); emailService = MockRepository.GenerateStub<IEmailService>(); var mocks = new MockRepository(); //TODO: No need to partial mock once email sending is fixed controller = new CheckoutController( basketRepository, userService, postageService, countryRepository, cardTypeRepository, orderRepository, unitOfWorkManager, emailService, subscriptionRepository ); mocks.ReplayAll(); userService.Expect(us => us.CurrentUser).Return(new User { UserId = 4, RoleId = Role.AdministratorId }); }
public void Setup() { basketRepository = MockRepository.GenerateStub<IRepository<Basket>>(); unitOfWorkManager = MockRepository.GenerateStub<IUnitOfWorkManager>(); userService = MockRepository.GenerateStub<IUserService>(); orderRepository = new FakeRepository<Order>(); MockRepository.GenerateStub<IEncryptionService>(); checkoutService = MockRepository.GenerateStub<ICheckoutService>(); controller = new CheckoutController( basketRepository, userService, orderRepository, unitOfWorkManager, checkoutService ); userService.Stub(us => us.CurrentUser).Return(new User { Id = 4, Role = Role.Administrator }); }