コード例 #1
0
        public void TestMethod2()
        {
            string  str = "GETT/resurs";
            Request obj = RequestFactory.ConvertStringToRequest(str);

            Assert.IsNull(obj);  //proveravam da li je uopste uspelo
        }
コード例 #2
0
        public void TestMethod1(string str)
        {
            Request obj = RequestFactory.ConvertStringToRequest(str);

            Assert.IsNotNull(obj);  //proveravam da li je uopste uspelo
            var delovi = str.Split('/');

            Assert.AreEqual(obj.Verb, str[0]);
            Assert.AreEqual(obj.Noun, str[1]);
        }
コード例 #3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            ValidationOfRequest validation = new ValidationOfRequest();

            if (!validation.ValidateRequest(TextBoxEnter.Text))
            {
                MessageBox.Show("Pls enter valid request.");
                return;
            }

            Request request = RequestFactory.ConvertStringToRequest(TextBoxEnter.Text);
            string  json    = JsonConvert.SerializeObject(request, Formatting.Indented);

            JsonFormat.Text = json;
            CommunicationBusModule cmb = new CommunicationBusModule();
            string response            = cmb.SendRequest(json);

            XmlFormat.Text = cmb.XmlRequest.ToString();

            txtBoxResponse.Text = response;
        }
コード例 #4
0
        //GET/Resources//Name='Petar';Description='opis'/Name;Description
        //GET/Resources//Name='Petar';Description='opis'"
        public void ConvertStringToRequest_MakingRequest_ReturnNotNullValue(string stringRequest)
        {
            Request request = RequestFactory.ConvertStringToRequest(stringRequest);

            Assert.IsNotNull(request);
        }