Esempio 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;
                    }
                }
            }
            ;
        }
Esempio n. 2
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            var passed    = 0;
            var failed    = 0;
            var executed  = 0;
            var testsList = TestsController.GetTests(servicenameList.SelectedValue.ToString());

            foreach (var item in testsList)
            {
                var testExecuted = TestsController.GetSOAPResponse(item.Uri, item.Request, User, null);
                executed = executed + 1;
                if (testExecuted.Response == item.Response)
                {
                    passed = passed + 1;
                }
                else
                {
                    failed = failed + 1;
                }
            }
            testeExecutate.Content = executed;
            testeFailed.Content    = failed;
            testePassed.Content    = passed;
        }