예제 #1
0
        public void Does_not_encode_when_Unencoded_attribute_used()
        {
            var test = new TestClassWithUnencodedProperty {
                Name = "hello there"
            };
            var result = new HttpPostSerializer().Serialize(test);

            result.ShouldEqual("Name=hello there");
        }
예제 #2
0
        public void Formats_property()
        {
            var test = new TestClassWithFormat {
                Age = 5.5m
            };
            var result = new HttpPostSerializer().Serialize(test);

            result.ShouldEqual("Age=5.50");
        }
예제 #3
0
        public void Encodes_property()
        {
            var test = new TestClass {
                Name = "hello there"
            };
            var result = new HttpPostSerializer().Serialize(test);

            result.ShouldEqual("Name=hello+there&Age=0");
        }
예제 #4
0
        public void Excludes_optional_Item()
        {
            var test = new TestClass {
                Age = 4
            };
            var result = new HttpPostSerializer().Serialize(test);

            result.ShouldEqual("Age=4");
        }