public void send_message_that_gets_through_the_first_behavior_and_is_handled_by_the_last()
        {
            var input = new CharacterInput{
                CharacterClass = "Ninja",
                Race = "Troll"
            };

            endpoints.PostJson(input).ReadAsText().ShouldEqual("{\"success\":true,\"refresh\":false}");
        }
        public void send_message_that_gets_through_the_first_behavior_and_is_handled_by_the_last()
        {
            var input = new CharacterInput {
                CharacterClass = "Ninja",
                Race           = "Troll"
            };

            endpoints.PostJson(input).ReadAsText().ShouldEqual("{\"success\":true,\"refresh\":false}");
        }
        public void send_message_that_gets_caught_by_validation_behavior()
        {
            var input = new CharacterInput
            {
                CharacterClass = "Paladin",
                Race           = "Ogre"
            };

            var text = endpoints.PostJson(input).ReadAsText();

            text.ShouldEqual("{\"success\":false,\"refresh\":false,\"errors\":[{\"category\":null,\"field\":\"Character\",\"label\":null,\"message\":\"Ogres cannot be Paladins!\"}]}");
        }
        public void send_message_that_gets_caught_by_validation_behavior()
        {
            var input = new CharacterInput
            {
                CharacterClass = "Paladin",
                Race = "Ogre"
            };

            var text = endpoints.PostJson(input).ReadAsText();

            text.ShouldEqual("{\"success\":false,\"refresh\":false,\"errors\":[{\"category\":null,\"field\":\"Character\",\"label\":null,\"message\":\"Ogres cannot be Paladins!\"}]}");
        }
        public void send_message_that_gets_through_the_first_behavior_and_is_handled_by_the_last()
        {
            using (var server = FubuApplication.For<TestRegistry>().StructureMap(new Container()).RunEmbedded(port:PortFinder.FindPort(5500)))
            {
                var input = new CharacterInput
                {
                    CharacterClass = "Ninja",
                    Race = "Troll"
                };

                server.Endpoints.PostJson(input).ReadAsText().ShouldEqual("{\"success\":true,\"refresh\":false}");
            }
        }
Esempio n. 6
0
        public void send_message_that_gets_through_the_first_behavior_and_is_handled_by_the_last()
        {
            using (var server = FubuApplication.For <TestRegistry>().StructureMap(new Container()).RunEmbedded(port: PortFinder.FindPort(5500)))
            {
                var input = new CharacterInput
                {
                    CharacterClass = "Ninja",
                    Race           = "Troll"
                };

                server.Endpoints.PostJson(input).ReadAsText().ShouldEqual("{\"success\":true,\"refresh\":false}");
            }
        }
        public void send_message_that_gets_caught_by_validation_behavior()
        {
            using (var server = FubuApplication.For<TestRegistry>().StructureMap(new Container()).RunEmbedded(port: PortFinder.FindPort(5500)))
            {
                var input = new CharacterInput
                {
                    CharacterClass = "Paladin",
                    Race = "Ogre"
                };

                var text = server.Endpoints.PostJson(input).ReadAsText();

                text.ShouldEqual("{\"success\":false,\"refresh\":false,\"errors\":[{\"category\":null,\"field\":\"Character\",\"label\":null,\"message\":\"Ogres cannot be Paladins!\"}]}");
            }
        }
Esempio n. 8
0
        public void send_message_that_gets_caught_by_validation_behavior()
        {
            using (var server = FubuApplication.For <TestRegistry>().StructureMap(new Container()).RunEmbedded(port: PortFinder.FindPort(5500)))
            {
                var input = new CharacterInput
                {
                    CharacterClass = "Paladin",
                    Race           = "Ogre"
                };

                var text = server.Endpoints.PostJson(input).ReadAsText();

                text.ShouldEqual("{\"success\":false,\"refresh\":false,\"errors\":[{\"category\":null,\"field\":\"Character\",\"label\":null,\"message\":\"Ogres cannot be Paladins!\"}]}");
            }
        }
 public AjaxContinuation post_save_character(CharacterInput input)
 {
     return AjaxContinuation.Successful();
 }
 public AjaxContinuation post_save_character(CharacterInput input)
 {
     return(AjaxContinuation.Successful());
 }