public void Create_WithRentModel_InvokesCreateFromRentData() { mocker.Setup(o => o.Create(rentModelWithoutDiscount)); IRentBusiness sut = GetSut(); sut.Create(rentModelWithoutDiscount); mocker.Verify(o => o.Create(rentModelWithoutDiscount), Times.Once); }
public void Create_WithDiscount_VerifyDiscount() { RentModel rentModel = new RentModel { Bicycles = 3, Cost = hourCost, Count = 1, Date = DateTime.Now }; mocker.Setup(o => o.Create(rentModel)); IRentBusiness sut = GetSut(); sut.Create(rentModel); Assert.AreEqual(DoDiscount(rentModel), rentModel.Price); }
public void Create_WithWeeksCost_CalculateReturnDate() { RentModel rentModel = new RentModel { Bicycles = 3, Cost = weekCost, Count = 1, Date = DateTime.Now }; mocker.Setup(o => o.Create(rentModel)); IRentBusiness sut = GetSut(); sut.Create(rentModel); Assert.AreEqual(CalculateReturnDate(rentModel), rentModel.ReturnDate); }