예제 #1
0
        public void TestClassDoNotEncodListValues()
        {
            var obj    = new DictionaryObjectTestClass1();
            var result = obj.ToQueryString(_serializationOptionsUrlDisableEncode1);

            result.Should().NotBeNullOrEmpty("Query String creation failed");
            result.Should().Contain("Param1=Class1 Value");
            result.Should().Contain("Param2=1");
            result.Should().Contain("ParamList1=listItem1,listItem2,listItem3");
        }
예제 #2
0
        public void TestSimpleClassIgnoreBasedOnAttributes()
        {
            var obj    = new DictionaryObjectTestClass1();
            var result = obj.ToQueryString(_serializationOptionsAttributeFilter2);

            result.Should().NotBeNullOrEmpty("Query String creation failed");
            result.Should().Contain("Param1=Class1%20Value");
            result.Should().Contain("Param2=1");
            result.Should().NotContain("ParamList1=listItem1%2ClistItem2%2ClistItem3");
        }
예제 #3
0
        public void TestSimpleClassDefaultOptions()
        {
            var obj    = new DictionaryObjectTestClass1();
            var result = obj.ToQueryString();

            result.Should().NotBeNullOrEmpty("Query String creation failed");
            result.Should().Contain("Param1=Class1%20Value");
            result.Should().Contain("Param2=1");
            result.Should().Contain("ParamList1=listItem1%2ClistItem2%2ClistItem3");
            result.Should().NotContain("someParam1=Class1Value");
        }
예제 #4
0
        public void TestQueryParamFunc1()
        {
            var obj    = new DictionaryObjectTestClass1();
            var result = obj.ToQueryString(_serializationOptionsUrlQueryParamFunc1);

            result.Should().NotBeNullOrEmpty("Query String creation failed");
            result.Should().Contain("Param1=Class1%20ValueModfied");
            result.Should().Contain("Param2=1");
            result.Should().Contain("ParamList1=listItem1%2ClistItem2%2ClistItem3");
            result.Should().NotContain("someParam1=Class1Value");
        }