Пример #1
0
        public PartialUpdateBookingTests()
        {
            testData = new DataGenerator();

            // Test Info;
            HttpClient.Url    = TestUrl.BookingWithId(testData.BookingId);
            HttpClient.Method = "PATCH";

            HttpClient.AddHeader("Accept", "application/json");
            HttpClient.AddHeader("Authorization", "Basic YWRtaW46cGFzc3dvcmQxMjM=");

            BookingModel.AdditionalNeeds = "Dinner";
        }
Пример #2
0
        public UpdateBookingTests()
        {
            // Set the API endpoint and request method;
            HttpClient.Url    = TestUrl.BookingWithId(1);
            HttpClient.Method = "PATCH";

            // Set the Header information;
            HttpClient.AddHeader("Content-type", "application/json");
            HttpClient.AddHeader("Accept", "application/json");
            HttpClient.AddHeader("Authorization", "Basic YWRtaW46cGFzc3dvcmQxMjM=");

            // Create BookingModel object;
            BookingModel.FirstName             = "John";
            BookingModel.LastName              = "Doe";
            BookingModel.TotalPrice            = 1110;
            BookingModel.DepositPaid           = true;
            BookingModel.BookingDates.Checkin  = "2020-01-01";
            BookingModel.BookingDates.Checkout = "2021-01-01";
            BookingModel.AdditionalNeeds       = "Breakfest";
        }
Пример #3
0
        /// <summary>
        /// called on execution of task. Sends the new testcases to the Testservice.
        /// </summary>
        /// <returns>boolean with true in success case, else returns false</returns>
        public override bool Execute()
        {
            try
            {
                Log.LogMessage(MessageImportance.Normal, "Starting UITests at " + EndpointAdress);
                using (WcfClient wcfClient = new WcfClient(EndpointAdress))
                {
                    Guid testjob = wcfClient.SendFile(TestFile, TestUrl.ToLower());
                    Log.LogMessage(MessageImportance.Normal, "Started testjob with id " + testjob);
                    WriteTestjobFile(testjob.ToString());
                }
            }
            catch (Exception exception)
            {
                Log.LogErrorFromException(exception);
                return(false);
            }

            return(true);
        }