public void SaveStatus() { var orderId = new Guid("7BC69EB6-805F-45DB-8B7F-89B3E7580549"); var provider = new OrderProvider(); var initialStatus = provider.GetBy(orderId).Status; var newStatus = initialStatus != OrderStatus.Paid ? OrderStatus.Paid : OrderStatus.Viewed; var order = new Order { Id = orderId, Status = newStatus }; provider.SaveStatus(order); Assert.AreEqual(newStatus, provider.GetBy(orderId).Status); // roll back order.Status = initialStatus; provider.SaveStatus(order); Assert.AreEqual(initialStatus, provider.GetBy(orderId).Status); }
public Option <Order> GetBy(Guid orderId) => _provider.GetBy(orderId).AsOption();