Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }