public void Update_WithRentModel_InvokesUpdateFromRentData() { mocker.Setup(o => o.Update(rentModelWithoutDiscount)); IRentBusiness sut = GetSut(); sut.Update(rentModelWithoutDiscount); mocker.Verify(o => o.Update(rentModelWithoutDiscount), Times.Once); }
public void Update_WithDateTimeNow_CalculateReturnDate() { RentModel rentModel = new RentModel { Id = id, Bicycles = 3, Cost = hourCost, Count = 1, Date = DateTime.Now }; mocker.Setup(o => o.Update(rentModel)); IRentBusiness sut = GetSut(); sut.Update(rentModel); Assert.AreEqual(CalculateReturnDate(rentModel), rentModel.ReturnDate); }
public void Update_WithDiscount_VerifyDiscount() { RentModel rentModel = new RentModel { Id = id, Bicycles = 3, Cost = hourCost, Count = 1, Date = DateTime.Now }; mocker.Setup(o => o.Update(rentModel)); IRentBusiness sut = GetSut(); sut.Update(rentModel); Assert.AreEqual(DoDiscount(rentModel), rentModel.Price); }