public void PayReservation_UserCanPaidReservation_ThrowsNotImplemented()
        {
            var userComplex        = new UserComplex();
            var reservationComplex = new ReservationComplex();

            userComplex.Money = 100;

            Assert.Throws <NotImplementedException>(() => reservationComplex.PayReservation(userComplex));
        }
Beispiel #2
0
        public void user_is_null()
        {
            var reservation = new ReservationComplex
            {
                Price = 50
            };

            Assert.That(reservation.PayReservation(null), Is.EqualTo(-404));
        }
Beispiel #3
0
        public void PayReservation_userIsNull_null()
        {
            //Arrange
            var userReservationComplex = new UserComplex();

            var reservationComplex = new ReservationComplex();

            //Act
            var result = reservationComplex.PayReservation(userReservationComplex);

            //Assert
            Assert.That(result, Is.Null);
        }
Beispiel #4
0
        public void user_cant_pay_reservation_return_1()
        {
            var user = new UserComplex
            {
                Money   = 200,
                IsAdmin = false
            };

            var reservation = new ReservationComplex
            {
                Price = 500
            };

            Assert.That(reservation.PayReservation(user), Is.EqualTo(1));
        }
Beispiel #5
0
        public void ReservationComplex_MoneySmallerThanPrice_ReturnsZero()
        {
            //Arrange
            var reservationComplex = new ReservationComplex()
            {
                Price = 500
            };
            var paco = new UserComplex()
            {
                Money = 200
            };

            //Act
            //Assert
            Assert.Throws <ArgumentOutOfRangeException>(() => reservationComplex.PayReservation(paco));
        }
Beispiel #6
0
        public void PayReservation_UserThereIsEqualMoney_Returns0()
        {
            //Arrange
            var userReservationComplex = new UserComplex();

            userReservationComplex.Money = 200;

            var reservationComplex = new ReservationComplex();

            reservationComplex.Price = 200;

            //Act
            var result = reservationComplex.PayReservation(userReservationComplex);

            //Assert
            Assert.That(result, Is.GreaterThanOrEqualTo(0));
        }
Beispiel #7
0
        public void PayReservation_UserThereIsNoMoney_ReturnsDifferenceMoney()
        {
            //Arrange
            var userReservationComplex = new UserComplex();

            userReservationComplex.Money = 100;

            var reservationComplex = new ReservationComplex();

            reservationComplex.Price = 200;

            //Act
            var result = reservationComplex.PayReservation(userReservationComplex);

            //Assert
            Assert.That(result, Is.GreaterThan(0));
        }
Beispiel #8
0
        public void PayReservation_UserThereIsMoney_Returns0()
        {
            //Arrange
            var userReservationComplex = new UserComplex();

            userReservationComplex.Money = 300;

            var reservationComplex = new ReservationComplex();

            reservationComplex.Price = 200;

            //Act
            var result = reservationComplex.PayReservation(userReservationComplex);

            //Assert
            Assert.That(result, Is.Zero);
        }
        public void MoneyUser_IsLowerPrice_Returns0()
        {
            //Arrange
            var persona = new UserComplex()
            {
                IsAdmin = false, Money = 20
            };
            var reservation = new ReservationComplex()
            {
                MadeBy = persona, Price = 30
            };

            //Act
            var result = reservation.PayReservation(persona);

            //Assert
            Assert.AreEqual(result, 1);
        }
        public void MoneyUser_IsHigherPrice_ReturnsResultOperation()
        {
            //Arrange
            var persona = new UserComplex()
            {
                IsAdmin = false, Money = 50
            };
            var reservation = new ReservationComplex()
            {
                MadeBy = persona, Price = 30
            };

            //Act
            var result = reservation.PayReservation(persona);

            //Assert
            Assert.AreEqual(persona.Money, 20);
        }
Beispiel #11
0
        public void ReservationComplex_MoneyEqualThanPrice_ReturnsZero()
        {
            //Arrange
            var reservationComplex = new ReservationComplex()
            {
                Price = 1000
            };
            var paco = new UserComplex()
            {
                Money = 1000
            };

            //Act
            var result = reservationComplex.PayReservation(paco);

            //Assert
            Assert.AreEqual(result, 0);
        }
Beispiel #12
0
        public void user_pay_reservation_and_reduce_his_money()
        {
            var user = new UserComplex
            {
                Money   = 200,
                IsAdmin = false
            };

            var reservation = new ReservationComplex
            {
                Price = 50
            };

            var mainMoney = user.Money;


            reservation.PayReservation(user);

            Assert.That(user.Money, Is.EqualTo(mainMoney - reservation.Price));
        }
        public void PayReservation_UserIsNull_ThrowsNotImplementedException()
        {
            var reservationComplex = new ReservationComplex();

            Assert.Throws <NotImplementedException>(() => reservationComplex.PayReservation(null));
        }