Exemplo n.º 1
0
        public void NextRentalDue_ReturnsNullWithNoRentals()
        {
            Renter renter = new Renter()
            {
                Rentals = new List <Rental>()
            };
            Rental actual = renter.NextRentalDue();

            Assert.Null(actual);
        }
Exemplo n.º 2
0
        public void NextRentalDue_ReturnsNullWithNoRentals()
        {
            //Arrange
            Renter renter = new Renter();

            //Act

            //Assert
            Assert.Null(renter.NextRentalDue());
        }
Exemplo n.º 3
0
        public void NextRentalDue_ReturnsCorrectRental()
        {
            //Arrange
            Renter renter = new Renter();

            Rental rental = new Rental()
            {
                ReturnTime = DateTime.Today.AddDays(10)
            };
            Rental rental2 = new Rental()
            {
                ReturnTime = DateTime.Today
            };


            //Act
            renter.Rentals.Add(rental);
            renter.Rentals.Add(rental2);

            //Assert
            Assert.Equal(rental2, renter.NextRentalDue());
        }
Exemplo n.º 4
0
        public void NextRentalDue_ReturnsCorrectRental()
        {
            Renter renter = new Renter()
            {
                Rentals = new List <Rental>()
                {
                    new Rental()
                    {
                        ReturnTime = DateTime.Now.AddDays(1)
                    }, new Rental()
                    {
                        ReturnTime = DateTime.Now.AddDays(2)
                    }, new Rental()
                    {
                        ReturnTime = DateTime.Now.AddDays(3)
                    }
                }
            };
            Rental expected = renter.Rentals[0];
            Rental actual   = renter.NextRentalDue();

            Assert.Same(expected, actual);
        }