Example #1
0
        public void GivenAValidAPIWithKeyValuePairToBePassed()
        {
            //Get Input
            Dictionary <string, string> prop = Utility.readProperties();
            //Create Client URL connection
            RestAPIFunctions apifunc = new RestAPIFunctions();

            apifunc.passClient(prop);
        }
Example #2
0
        private async void Add_User_Click(object sender, RoutedEventArgs e)
        {
            var response = await RestAPIFunctions.Post(txtName.Text, txtEmail.Text, cmbGender.Text, cmbStatus.Text);

            //EmployeeData.ItemsSource = RestAPIFunctions.BeautifyJson(response);
            //Refresh the table!
            _ = RestAPIFunctions.GetAll();
            MainWindow mainwindow = new MainWindow();

            mainwindow.lblPageInfo.Content = mainwindow.PageNumberDisplay();
        }
Example #3
0
        public void WeatherComparator()
        {
            try
            {
                //webpage to fetch temperature
                Dictionary <string, string> prop = Utility.readProperties();

                Temperature tempUI = new Temperature();
                tempUI.setCity(prop["CityName"]);

                UIFunctions uifunc = new UIFunctions(driver);
                uifunc.Launch(prop);
                uifunc.navigateToWeatherPage();
                uifunc.explicitWait();
                uifunc.searchCity(prop);
                float uiTemp = uifunc.readCityWeatherDetails(prop);
                tempUI.setTemp(uiTemp);
                uifunc.closeDriver();

                //REST API to fetch temperature
                Temperature tempAPI = new Temperature();
                tempAPI.setCity(prop["CityName"]);
                //Create Client URL connection
                RestAPIFunctions apifunc = new RestAPIFunctions();
                apifunc.passClient(prop);
                //Create REST API Request
                apifunc.createRequest(prop);
                //Fetch response

                float apiTemp = apifunc.fetchResponse(prop);
                tempAPI.setTemp(apiTemp);

                Utility utilCompare = new Utility();
                Dictionary <string, string> prop2 = Utility.variance();
                utilCompare.Comparator(tempAPI.getTemp(), tempUI.getTemp(), prop2);
            }
            catch (Exception ex)
            {
            }
        }
Example #4
0
 public void ThenTheResponseFromTheAPIGetsUsTheTemperatureOfTheIndianCity(RestAPIFunctions apifunc, Dictionary <string, string> prop)
 {
     apifunc.fetchResponse(prop);
 }
Example #5
0
 public void WhenRequestToTheAPIIsSent(RestAPIFunctions apifunc, Dictionary <string, string> prop)
 {
     apifunc.createRequest(prop);
 }