Пример #1
0
        public void Fact9PackageProfileStudentVsEconomy()
        {
            PackageSearchProfile.RootObject packageSearchProfile = new PackageSearchProfile.RootObject();
            PackageSearchProfile            profile = new PackageSearchProfile();
            var    student          = profile.Student();
            var    economy          = profile.Economy();
            ID_nom pp               = new ID_nom();
            var    resultstudentID  = program.Post_zapros("https://apitest.suntigo.com/api/1/package/search", student, pp);
            var    result2economyID = program.Post_zapros("https://apitest.suntigo.com/api/1/package/search", economy, pp);

            var resultstudent  = program.Get <PackageResultsProfile.RootObject>("https://apitest.suntigo.com/api/1/package/results", "RequestId", resultstudentID.requestId, "Language", "English");
            var result2economy = program.Get <PackageResultsProfile.RootObject>("https://apitest.suntigo.com/api/1/package/results", "RequestId", result2economyID.requestId, "Language", "English");

            Assert.True(!program.EqualsResults(resultstudent, result2economy));
        }
Пример #2
0
        public void Fact9PackageProfileEconomyPlusVsVIP()
        {
            PackageSearchProfile.RootObject packageSearchProfile = new PackageSearchProfile.RootObject();
            PackageSearchProfile            profile = new PackageSearchProfile();
            var    economyPlus         = profile.EconomyPlus();
            var    vip                 = profile.VIP();
            ID_nom pp                  = new ID_nom();
            var    resulteconomyPlusID = program.Post_zapros("https://apitest.suntigo.com/api/1/package/search", economyPlus, pp);
            var    result2VIPID        = program.Post_zapros("https://apitest.suntigo.com/api/1/package/search", vip, pp);

            var resulteconomyPlus = program.Get <PackageResultsProfile.RootObject>("https://apitest.suntigo.com/api/1/package/results", "RequestId", resulteconomyPlusID.requestId, "Language", "English");
            var result2VIP        = program.Get <PackageResultsProfile.RootObject>("https://apitest.suntigo.com/api/1/package/results", "RequestId", result2VIPID.requestId, "Language", "English");

            Assert.True(!program.EqualsResults(resulteconomyPlus, result2VIP));
        }
Пример #3
0
        public void Fact9PackageProfileStudentVsVip()
        {
            //TrainProfile.RootObject zapros = new TrainProfile.RootObject();
            //zapros.adults = 2;
            //zapros.routes[0].origin = 1;
            //zapros.routes[0].destination = 2;
            //zapros.routes[0].destinationAirportCode = ""; 12

            //zapros.routes[1].origin = 1;
            //zapros.routes[1].destination = 2;
            //zapros.routes[1].destinationAirportCode = "";

            //zapros.profile.
            ID_nom p = new ID_nom();

            //var otvetTrainProfile = program.Post_zapros("https://apitest.suntigo.com/api/1/package/search", zapros, p);



            //нужно сравнить два объекта при разных запросах в профиле и сравнить полученный результат1
            //создать и заполнить объект
            PackageSearchProfile.RootObject packageSearchProfile = new PackageSearchProfile.RootObject();

            packageSearchProfile.adults = 2;
            packageSearchProfile.routes = new List <PackageSearchProfile.Route>();

            PackageSearchProfile.Route routePackage  = new PackageSearchProfile.Route();
            PackageSearchProfile.Route routePackage2 = new PackageSearchProfile.Route();

            routePackage.origin                 = 2395;
            routePackage.destination            = 513;
            routePackage.destinationAirportCode = routePackage.destination.ToString();

            routePackage.date                    = program.Friday_Sunday(dateTime).ToString();
            routePackage2.date                   = program.Friday_Sunday(dateTime).AddDays(2).ToString();
            routePackage2.origin                 = 513;
            routePackage2.destination            = 2395;
            routePackage2.destinationAirportCode = routePackage2.destination.ToString();
            packageSearchProfile.routes.Add(routePackage);
            packageSearchProfile.routes.Add(routePackage2);
            //руты заполнены

            //тип студент 123
            PackageSearchProfile.TicketProfile ticketProfileOne = new PackageSearchProfile.TicketProfile();
            ticketProfileOne.serviceClass = "E";
            ticketProfileOne.stops        = "0,4";
            List <int> mastransportTypes = new List <int>();

            mastransportTypes.Add(1);
            mastransportTypes.Add(2);
            mastransportTypes.Add(3);
            ticketProfileOne.transportTypes = mastransportTypes; // тот же лист, должен встать, как по маслу
            //тикет профаил заполнен
            packageSearchProfile.ticketProfile = ticketProfileOne;

            PackageSearchProfile.HotelProfile hotelProfile = new PackageSearchProfile.HotelProfile();


            hotelProfile.freeCancellation = false;
            List <string> hoteltyp = new List <string>();

            hoteltyp.Add("hotel");
            hoteltyp.Add("hostel");
            hoteltyp.Add("apartment");
            hoteltyp.Add("mini-hotel");
            hotelProfile.hotelTypes = hoteltyp;
            //хотел типс заполнен
            //милсы нуль132

            List <string> stars = new List <string>();

            stars.Add("1");
            stars.Add("2");
            stars.Add("3");
            hotelProfile.stars  = stars;
            hotelProfile.rating = "5,8";

            packageSearchProfile.hotelProfile = hotelProfile;
            //используется та же ссылка packageSearchProfile внутри дальше меняем только профайлы если строку сместить вниз будет ошибка
            ID_nom pp = new ID_nom();
            var    otvetPackageProfile = program.Post_zapros("https://apitest.suntigo.com/api/1/package/search", packageSearchProfile, pp);

            PackageSearchProfile.TicketProfile ticketProfile2 = new PackageSearchProfile.TicketProfile();
            ticketProfile2.serviceClass   = "B";
            ticketProfile2.stops          = "0,1";
            ticketProfile2.transportTypes = mastransportTypes;

            PackageSearchProfile.HotelProfile hotelProfile2 = new PackageSearchProfile.HotelProfile();
            List <string> hoteltyp2 = new List <string>();

            hoteltyp2.Add("hotel");
            hoteltyp2.Add("apartment");
            hotelProfile2.hotelTypes = hoteltyp2;

            List <string> stars2 = new List <string>();

            stars2.Add("4");
            stars2.Add("5");

            hotelProfile2.stars  = stars2;
            hotelProfile2.rating = "7,10";

            packageSearchProfile.ticketProfile = ticketProfile2;
            packageSearchProfile.hotelProfile  = hotelProfile2;

            var otvetPackageProfile2 = program.Post_zapros("https://apitest.suntigo.com/api/1/package/search", packageSearchProfile, pp);

            //PackageResultsProfile.RootObject resVersion1 = new PackageResultsProfile.RootObject();

            var res = program.Get <PackageResultsProfile.RootObject>("https://apitest.suntigo.com/api/1/package/results", "RequestId", otvetPackageProfile.requestId, "Language", "English");

            var res2 = program.Get <PackageResultsProfile.RootObject>("https://apitest.suntigo.com/api/1/package/results", "RequestId", otvetPackageProfile2.requestId, "Language", "English");

            //влейся авыаы gfdgd
            Assert.True(!program.EqualsResults(res, res2));
        }