Esempio n. 1
0
        public void SubmitRental()
        {
            int custId = 404485;

            var drivers = new List <Driver2>();

            drivers.Add(new Driver2()
            {
                name = "James-0"
            });
            drivers.Add(new Driver2()
            {
                name = "James-1"
            });
            drivers.Add(new Driver2()
            {
                name = "James-2"
            });

            var extras = new List <ExtraProduct>();

            extras.Add(new ExtraProduct()
            {
                id = 1, numbUnit = "1"
            });
            extras.Add(new ExtraProduct()
            {
                id = 2, numbUnit = "2"
            });
            extras.Add(new ExtraProduct()
            {
                id = 3, numbUnit = "3"
            });

            var rental = new Rental()
            {
                locationId        = 66,
                returnLocationId  = 66,
                productId         = 180,
                pickupDate        = convertDateTimeToCarlaDateTime(DateTime.Now.AddDays(10)),
                pickupTime        = "0800",
                returnDate        = convertDateTimeToCarlaDateTime(DateTime.Now.AddDays(11)),
                returnTime        = "0800",
                categoryId        = "A",
                coRenterName      = "Bonnie",
                coRenterSurName   = "Raith",
                coRenterLicenseNo = "012334560123456",
                coRenterBirthDay  = "02021996",
                rekvisitionNo     = "blank",
                payType           = "2",
                drivers           = drivers,
                extras            = extras
            };

            //Act
            var response = controller.SubmitRental(custId, rental);

            //Assert
            Assert.IsNotNull(response);
        }