Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }