public async void DeliverOrder_UpdateDataMethodShouldBeCalledOnlyOnce() { OrderModel expected = GetSampleOrder(); string sql = $"select * from Shipment where Id={expected.Id}"; _dbDataAccessMock .Setup(x => x.LoadDataAsync <OrderModel>(sql, expected.Id)) .ReturnsAsync(expected); var actual = await _orderProcessor.GetOrder(expected.Id); DateTime deliveryDate = DateTime.Now; await _orderProcessor.DeliverOrder(actual.Id, deliveryDate); string deliveryDateFormated = deliveryDate.ToString("yyyy-MM-dd HH:MM:ss"); sql = $"UPDATE Shipment SET DeliveryDate='{deliveryDateFormated}', State='{OrderState.Delivered}' WHERE Id='{actual.Id}'"; _dbDataAccessMock.Verify(x => x.UpdateDataAsync <OrderModel>(sql, actual), Times.Once); }