Ejemplo n.º 1
0
        private void btnSubmitSoap_Click(object sender, RoutedEventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(txtboxUrlSoap.Text))
            {
                var header = new Headers
                {
                    Name  = headername1.ToString(),
                    Value = headervalue1.ToString()
                };
                var test = TestsController.GetSOAPResponse(txtboxUrlSoap.Text, txtboxSoapRequest.Text, User, header);
                txtboxSoapResponse.Text  = test.Response;
                timeProcessing_Soap.Text = test.ProcessingTime.ToString();

                if (!string.IsNullOrWhiteSpace(key1soap.Text) && (!string.IsNullOrWhiteSpace(value1soap.Text)))
                {
                    var validare = TestsController.ValidateResponse(key1soap.Text, value1soap.Text, test.Response);
                    if (validare == 1)
                    {
                        assert1.Background = System.Windows.Media.Brushes.Green;
                    }
                    else if (validare == 0)
                    {
                        assert1.Background = System.Windows.Media.Brushes.Red;
                    }
                    else
                    {
                        assert1.Background = System.Windows.Media.Brushes.Yellow;
                    }
                }
                ;
                if (!string.IsNullOrWhiteSpace(key2soap.Text) && (!string.IsNullOrWhiteSpace(value2soap.Text)))
                {
                    var validare = TestsController.ValidateResponse(key2soap.Text, value2soap.Text, test.Response);
                    if (validare == 1)
                    {
                        assert2.Background = System.Windows.Media.Brushes.Green;
                    }
                    else if (validare == 0)
                    {
                        assert2.Background = System.Windows.Media.Brushes.Red;
                    }
                    else
                    {
                        assert2.Background = System.Windows.Media.Brushes.Yellow;
                    }
                }
            }
            ;
        }