public void testnextordernumber(int order, int expected) { InMemoryOrderRepository test = new InMemoryOrderRepository(); var result = test.GetNextOrderNumber(); Assert.AreEqual(result, expected); }
public void Testdeleteorder(int order, int expected) { InMemoryOrderRepository test = new InMemoryOrderRepository(); var result = test.DeleteOrder(order); Assert.AreEqual(result.Count, expected); }
public void testgetallorders(string choice, int expected) { InMemoryOrderRepository test = new InMemoryOrderRepository(); var result = test.GetAllOrdersByDate(choice); Assert.AreEqual(result.Count, expected); }
public void testNextOrderNumeber(int testNumber, int expected) { InMemoryOrderRepository obj = new InMemoryOrderRepository(); var result = obj.GetNextOrderNumber(); Assert.AreEqual(result, expected); }
public void Initialize() { RestbucksResources.BaseAddress = "http://restbucks.net"; _repository = new InMemoryOrderRepository(); var mapper = new PaymentRepresentationMapper(); _sut = new PaymentResource(new PaymentActivity(_repository, mapper)); }
private InMemoryOrderRepository GetOrderRepository() { var repository = new InMemoryOrderRepository(); repository.CreateAndAddNewOrder(); return(repository);; }
private CreateUseCase GetSut() { var repository = new InMemoryOrderRepository(); return(new CreateUseCase( repository, _customerRepository.Object, _productRepository.Object)); }
public void Initialize() { RestbucksResources.BaseAddress = "http://restbucks.net"; _repository = new InMemoryOrderRepository(); var mapper = new ReceiptRepresentationMapper(); var orderMapper = new OrderRepresentationMapper(new ItemRepresentationMapper()); _sut = new ReceiptResource(new ReadReceiptActivity(_repository, mapper), new CompleteOrderActivity(_repository, orderMapper)); }
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); }
public void StoresCreatedOrders(InMemoryOrderRepository sut, int orderCount) { // random number 2..10 orderCount = orderCount % 9 + 2; var createdOrders = new List <Order>(); for (var i = 0; i < orderCount; i++) { createdOrders.Add(sut.Create()); } for (var i = 0; i < orderCount; i++) { var createdOrder = createdOrders[i]; var order = sut.GetById(createdOrder.Id); Assert.Equal(createdOrder, order); Assert.Equal(i + 1, order.Id); } }
public OrdersController(InMemoryOrderRepository orderRepository, InMemoryPostamatRepository postamatRepository) { _orderRepository = orderRepository; _postamatRepository = postamatRepository; }