public void The_answer_should_be_overwritten_by_binding_even_if_already_supplied_in_xml_input()
        {
            var theInput = new XmlInput
            {
                BadThing1 = "Vader",
                BadThing2 = "Jabba",
                TheAnswerToLifeTheUniverseAndEverything = 13
            };

            var output = endpoints.PostXml(theInput)
                         .StatusCodeShouldBe(HttpStatusCode.OK)
                         .ReadAsJson <XmlInput>();

            output.TheAnswerToLifeTheUniverseAndEverything.ShouldEqual(42);
        }
        public void The_answer_should_be_overwritten_by_binding_even_if_already_supplied_in_xml_input()
        {
            var theInput = new XmlInput
            {
                BadThing1 = "Vader",
                BadThing2 = "Jabba",
                TheAnswerToLifeTheUniverseAndEverything = 13
            };

            var output = endpoints.PostXml(theInput)
                                  .StatusCodeShouldBe(HttpStatusCode.OK)
                                  .ReadAsJson<XmlInput>();

            output.TheAnswerToLifeTheUniverseAndEverything.ShouldEqual(42);
        }
        public void The_answer_should_be_model_bound_when_posting_xml()
        {
            var theInput = new XmlInput
            {
                BadThing1 = "Vader",
                BadThing2 = "Jabba"
            };

            var output = endpoints.PostXml(theInput)
                         .StatusCodeShouldBe(HttpStatusCode.OK)
                         .ReadAsJson <XmlInput>();

            output.BadThing1.ShouldEqual("Vader");
            output.BadThing2.ShouldEqual("Jabba");
            output.TheAnswerToLifeTheUniverseAndEverything.ShouldEqual(42);
        }
        public void The_answer_should_be_model_bound_when_posting_xml()
        {
            var theInput = new XmlInput
            {
                BadThing1 = "Vader",
                BadThing2 = "Jabba"
            };

            var output = endpoints.PostXml(theInput)
                                  .StatusCodeShouldBe(HttpStatusCode.OK)
                                  .ReadAsJson<XmlInput>();

            output.BadThing1.ShouldEqual("Vader");
            output.BadThing2.ShouldEqual("Jabba");
            output.TheAnswerToLifeTheUniverseAndEverything.ShouldEqual(42);
        }
Пример #5
0
        public void The_answer_should_be_overwritten_by_binding_even_if_already_supplied_in_xml_input()
        {
            var theInput = new XmlInput
            {
                BadThing1 = "Vader",
                BadThing2 = "Jabba",
                TheAnswerToLifeTheUniverseAndEverything = 13
            };

            var output = TestHost.Scenario(_ =>
            {
                _.Post.Xml(theInput);
            }).Body.ReadAsXml <XmlInput>();

            output.TheAnswerToLifeTheUniverseAndEverything.ShouldBe(42);
        }
        public void The_answer_should_be_model_bound_when_posting_xml()
        {
            var theInput = new XmlInput
            {
                BadThing1 = "Vader",
                BadThing2 = "Jabba"
            };

            var output = TestHost.Scenario(_ =>
            {
                _.Post.Xml(theInput);
            }).Body.ReadAsXml<XmlInput>();

            output.BadThing1.ShouldBe("Vader");
            output.BadThing2.ShouldBe("Jabba");
            output.TheAnswerToLifeTheUniverseAndEverything.ShouldBe(42);
        }
Пример #7
0
        public void The_answer_should_be_model_bound_when_posting_xml()
        {
            var theInput = new XmlInput
            {
                BadThing1 = "Vader",
                BadThing2 = "Jabba"
            };

            var output = TestHost.Scenario(_ =>
            {
                _.Post.Xml(theInput);
            }).Body.ReadAsXml <XmlInput>();

            output.BadThing1.ShouldBe("Vader");
            output.BadThing2.ShouldBe("Jabba");
            output.TheAnswerToLifeTheUniverseAndEverything.ShouldBe(42);
        }
 public XmlInput Xml(XmlInput input)
 {
     return(input);
 }
 public XmlInput Xml(XmlInput input)
 {
     return input;
 }
        public void The_answer_should_be_overwritten_by_binding_even_if_already_supplied_in_xml_input()
        {
            var theInput = new XmlInput
            {
                BadThing1 = "Vader",
                BadThing2 = "Jabba",
                TheAnswerToLifeTheUniverseAndEverything = 13
            };

            var output = TestHost.Scenario(_ =>
            {
                _.Post.Xml(theInput);
            }).Body.ReadAsXml<XmlInput>();

            output.TheAnswerToLifeTheUniverseAndEverything.ShouldBe(42);
        }