Exemplo n.º 1
0
 public static bool availibleStatusToNextRent(rent Rent1, rent Rent2)
 {
     if (Rent1.endRent <= Rent2.startRent)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 2
0
 public static bool checkRentStatus(rent Rent, DateTime expectedDate)
 {
     if (Rent.endRent <= expectedDate)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 3
0
        public void checkRentStatus_RentStatusTrue()
        {
            rent newRent = new rent();

            newRent.endRent = new DateTime(2019, 1, 1);
            DateTime expectedDate = new DateTime(2020, 1, 1);

            bool expected = true;
            bool result   = rent.checkRentStatus(newRent, expectedDate);

            Assert.AreEqual(expected, result);
        }
Exemplo n.º 4
0
        public void checkAvailibleStatusToNextRent_RentStatusFalse()
        {
            rent Rent1 = new rent();
            rent Rent2 = new rent();

            Rent1.endRent   = new DateTime(2018, 1, 1);
            Rent2.startRent = new DateTime(2017, 1, 1);

            bool expected = false;
            bool result   = rent.availibleStatusToNextRent(Rent1, Rent2);

            Assert.AreEqual(expected, result);
        }