public HomeController() { // Replace this with IoC // Can Use TinyIoc, Unity, Ninject, Autofac etc lookupService = new LookupService(); userRepository = new UserRepository(); pricingOueryRepository = new PricingQueryRepository(); notificationService = new NotificationService(); }
public void SetUpTests() { _pricingQueryRepositoryMock = MockRepository.GenerateMock<IPricingQueryRepository>(); _emailingServiceMock = MockRepository.GenerateMock<IEmailingService>(); _customerPricingQueryEngineMock = MockRepository.GenerateMock<ICustomerPricingQueryEngine>(); _controllerUnderTest = new PricingQueryController(_pricingQueryRepositoryMock, _emailingServiceMock, _customerPricingQueryEngineMock); _result = _controllerUnderTest.Index() as ViewResult; }
public void SetUpTests() { _pricingQueryRepositoryMock = MockRepository.GenerateMock<IPricingQueryRepository>(); _emailingServiceMock = MockRepository.GenerateMock<IEmailingService>(); _customerPricingQueryEngineMock = MockRepository.GenerateMock<ICustomerPricingQueryEngine>(); _customerPricingQueryEngineMock .Expect(x => x.GenerateQuery(Arg<CustomerPricingQueryModel>.Is.Anything)) .Return(new PricingQuery { Products = new List<Product>(), Value = () => 100.0m }); _controllerUnderTest = new PricingQueryController(_pricingQueryRepositoryMock, _emailingServiceMock, _customerPricingQueryEngineMock); var customerPricingModel = SetUpCustomerPricingQueryModel(); _result = _controllerUnderTest.Register(customerPricingModel) as ViewResult; }
public PricingQueryController(IPricingQueryRepository pricingQueryRepository, IEmailingService emailingService, ICustomerPricingQueryEngine customerMapper) { _pricingQueryRepository = pricingQueryRepository; _emailingService = emailingService; _customerMapper = customerMapper; }
public void SetUp() { this.userRepository = new UserRepository(); this.productRepository = new ProductRepository(); this.pricingQueryRepository = new PricingQueryRepository(); }