public PaymentServiceTests()
 {
     this.regularStrategy      = new RegularCalculationService(new InMemoryPriceRepository());
     this.strategySelectorMock = new Mock <ICalculationStrategySelectorService>();
     this.clockMock            = new Mock <IClock>();
     this.billPaymentService   = new PaymentService(strategySelectorMock.Object, this.clockMock.Object);
 }
예제 #2
0
 public PaymentIntegrationTest()
 {
     this.platePriceService           = new InMemoryPriceRepository();
     this.regularBillCalculator       = new RegularCalculationService(platePriceService);
     this.menuBillCalculator          = new MenuCalculationService(platePriceService, new MenuSplitStrategyService());
     this.calculationStrategySelector = new CalculationStrategySelectorService(this.regularBillCalculator, this.menuBillCalculator);
     this.clockMock      = new Mock <IClock>();
     this.paymentService = new PaymentService(this.calculationStrategySelector, clockMock.Object);
 }
 public RegularBillCalculatorServiceTests()
 {
     this.platePriceServiceMock = new Mock <IPriceRepository>();
     this.platePriceServiceMock.Setup(svc => svc.GetPlatePrice(greyPlate)).Returns(GREY_PLATE_PRICE);
     this.platePriceServiceMock.Setup(svc => svc.GetPlatePrice(greenPlate)).Returns(GREEN_PLATE_PRICE);
     this.platePriceServiceMock.Setup(svc => svc.GetPlatePrice(yellowPlate)).Returns(YELLOW_PLATE_PRICE);
     this.platePriceServiceMock.Setup(svc => svc.GetPlatePrice(redPlate)).Returns(RED_PLATE_PRICE);
     this.platePriceServiceMock.Setup(svc => svc.GetPlatePrice(bluePlate)).Returns(BLUE_PLATE_PRICE);
     this.calculatorService = new RegularCalculationService(this.platePriceServiceMock.Object);
 }
 public OptmizedCalculationIntegrationTest()
 {
     this.priceRepository             = new InMemoryPriceRepository();
     this.regularBillCalculator       = new RegularCalculationService(priceRepository);
     this.menuBillCalculator          = new MenuCalculationService(priceRepository, new MenuSplitStrategyService());
     this.calculationStrategySelector = new CalculationStrategySelectorService(this.regularBillCalculator, this.menuBillCalculator);
     this.clockMock       = new Mock <IClock>();
     this.paymentService  = new PaymentService(this.calculationStrategySelector, clockMock.Object);
     this.orderRepository = new InMemoryOrderRepository();
     this.orderService    = new OrderService(this.paymentService, this.orderRepository, this.priceRepository, clockMock.Object);
 }