示例#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");
        }