public void PrintSessionSerializedPerson()
        {
            CookieContainer cookieContainer = new CookieContainer();

            GetAndSetSameRequest(cookieContainer);
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(
                TestHelpers_v2_0.DEFAULT_WITH_HELPERS +
                TestHelpers_v2_0.PRINT_SERIALIZED_PERSON);
            string result = TestHelpers_v2_0.DoRequest(request, cookieContainer);

            StringAssert.Contains(TestHelpers_v2_0.RemoveSpace(result), TestHelpers_v2_0.RemoveSpace(@"<fieldset>
        <legend>Person</legend>
    
        <div class=""display-label"">
            Name
        </div>
        <div class=""display-field"">
            Marc
        </div>
    
        <div class=""display-label"">
            Surname
        </div>
        <div class=""display-field"">
            Cortada
        </div>
    
        <div class=""display-label"">
            City
        </div>
        <div class=""display-field"">
            Barcelona
        </div>
    </fieldset>"));
        }
        public void GetAndSetSameRequest(CookieContainer cookieContainer = null)
        {
            cookieContainer = cookieContainer ?? new CookieContainer();
            HttpWebRequest request =
                (HttpWebRequest)WebRequest.Create(
                    TestHelpers_v2_0.DEFAULT_WITH_HELPERS +
                    TestHelpers_v2_0.GET_AND_SET_SAME_REQUEST);
            string result = TestHelpers_v2_0.DoRequest(request, cookieContainer);

            StringAssert.Contains(result, "<result>True</result>");
        }
        public void SessionValBool()
        {
            CookieContainer cookieContainer = new CookieContainer();
            HttpWebRequest  request         = (HttpWebRequest)WebRequest.Create(
                TestHelpers_v2_0.DEFAULT_WITH_HELPERS +
                TestHelpers_v2_0.SET_SESSION_VAL_BOOL_WITH_HELPERS),
                            request2 = (HttpWebRequest)WebRequest.Create(
                TestHelpers_v2_0.DEFAULT_WITH_HELPERS +
                TestHelpers_v2_0.PRINT_SESSION_VAL_BOOL);

            TestHelpers_v2_0.DoRequest(request, cookieContainer);
            string result = TestHelpers_v2_0.DoRequest(request2, cookieContainer);

            StringAssert.Contains(result, "<sessionVal>False</sessionVal>");
        }
Ejemplo n.º 4
0
        public void PritnBSONPerson()
        {
            CookieContainer cookieContainer = new CookieContainer();
            HttpWebRequest  request         = (HttpWebRequest)WebRequest.Create(
                TestHelpers_v2_0.DEFAULT_WITH_BSON +
                TestHelpers_v2_0.SET_BSON_VAL),
                            request2 = (HttpWebRequest)WebRequest.Create(
                TestHelpers_v2_0.DEFAULT_WITH_BSON +
                TestHelpers_v2_0.GET_BSON_VAL);

            TestHelpers_v2_0.DoRequest(request, cookieContainer);
            string result = TestHelpers_v2_0.DoRequest(request2, cookieContainer);

            StringAssert.Contains(TestHelpers_v2_0.RemoveSpace(result), TestHelpers_v2_0.RemoveSpace(@"<result>
            Name: Marc
            Surname: Cortada
            City: Barcelona
        </result>"));
        }
Ejemplo n.º 5
0
        //[TestMethod]
        public void GetAndSetValues()
        {
            CookieContainer cookieContainer = new CookieContainer();
            HttpWebRequest  request         =
                (HttpWebRequest)WebRequest.Create(TestHelpers_v2_0.BASE_URL_FORMS +
                                                  TestHelpers_v2_0.SET_VALUE_WEB_FORM),
                            request2 =
                (HttpWebRequest)WebRequest.Create(TestHelpers_v2_0.BASE_URL_FORMS +
                                                  TestHelpers_v2_0.GET_VALUE_WEB_FORM);

            string result = TestHelpers_v2_0.DoRequest(request, cookieContainer);

            StringAssert.Contains(result, "<result>OK</result>");

            string result2 = TestHelpers_v2_0.DoRequest(request2, cookieContainer);

            StringAssert.Contains(result2, @"<result1>314</result1>");
            StringAssert.Contains(result2, @"<result2>3,14</result2>");
            StringAssert.Contains(result2, @"<result3>Name: Marc, surname: Cortada</result3>");
            StringAssert.Contains(result2, @"<result4>Name: Marc2, surname: Cortada2, pet 1 cat, pet 2 dog</result4>");
        }