示例#1
0
        public void ContentHandlerObjectFromTypeInAssemblyWithParam()
        {
            var h   = new ContentHandler();
            var obj = h.ObjectFromTypeInAssemblyWithParams("xml", "RestTests.FewTypes", "RestTests.dll",
                                                           new[] { "true" });

            Assert.AreEqual(
                "<?xml version=\"1.0\" encoding=\"utf-16\"?>" +
                "<FewTypes xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
                "<BoolValue>true</BoolValue>" +
                "<ByteValue>255</ByteValue>" +
                "<CharValue>99</CharValue>" +
                "<DoubleValue>3.1415926535</DoubleValue>" +
                "<IntValue>2147483647</IntValue>" +
                "<LongValue>-223372036854775808</LongValue>" +
                "<StringValue>string value</StringValue>" +
                "</FewTypes>",
                obj.Serialize(), "FewTypes incorrectly serialized");
        }
示例#2
0
 public void ContentHandlerObjectFromTypeInAssemblyWithParamNonExisting()
 {
     var h   = new ContentHandler();
     var obj = h.ObjectFromTypeInAssemblyWithParams("xml", "RestTests.Bogus", "RestTests.dll",
                                                    new[] { "true" });
 }