public async Task GetOrder_NonExistentOrder_ReturnsNull() { var orderDataManager = new InMemoryOrderDataManager(); var getOrderResult = await orderDataManager.GetOrderAsync("test"); getOrderResult.Should().BeNull(); }
public async Task CreateOrder_NewOrderCreated_ReturnsNewOrder() { var orderDataManager = new InMemoryOrderDataManager(); var order = await orderDataManager.CreateOrderAsync(); order.Should().NotBeNull().And.BeOfType <Order>(); }
public async Task GetOrder_ExistingOrder_ReturnsExistingOrder() { var orderDataManager = new InMemoryOrderDataManager(); var order = await orderDataManager.CreateOrderAsync(); var getOrderResult = await orderDataManager.GetOrderAsync(order.Id); getOrderResult.Should().BeEquivalentTo(order); }
public async Task GetOrder_ExistingOrderIsDeleted_ReturnsNull() { var orderDataManager = new InMemoryOrderDataManager(); var order = await orderDataManager.CreateOrderAsync(); await orderDataManager.DeleteOrderAync(order.Id); var getOrderResult = await orderDataManager.GetOrderAsync(order.Id); getOrderResult.Should().BeNull(); }
public async Task UpdateOrder_ExistingOrderIsUpdated_ReturnsUpdatedOrder() { var orderDataManager = new InMemoryOrderDataManager(); var order = await orderDataManager.CreateOrderAsync(); order.Items.Add("test", new Item { Name = "teddy bear" }); var updateOrderResult = await orderDataManager.UpdateOrderAsync(order); updateOrderResult.Should().BeEquivalentTo(order); }