示例#1
0
        public void Should_be_able_to_send_json_in_body()
        {
            // Given
            var model = new EchoModel {
                SomeString = "Some String", SomeInt = 29, SomeBoolean = true
            };

            // When
            var result = browser.Post("/GetData/WEE", with =>
            {
                with.JsonBody(model);
            });


            // Then
            var actualModel = result.Content.DeserializeJson <EchoModel>();

            Assert.NotNull(actualModel);
            Assert.Equal(model.SomeString, actualModel.SomeString);
            Assert.Equal(model.SomeInt, actualModel.SomeInt);
            Assert.Equal(model.SomeBoolean, actualModel.SomeBoolean);
        }
        public void Should_be_able_to_send_json_in_body()
        {
            // Given
            var model = new EchoModel { SomeString = "Some String", SomeInt = 29, SomeBoolean = true };

            // When
            var result = browser.Post("/GetData/WEE", with =>
                                            {
                                                with.JsonBody(model);
                                            });


            // Then
            var actualModel = result.Content.DeserializeJson<EchoModel>();

            Assert.NotNull(actualModel);
            Assert.Equal(model.SomeString, actualModel.SomeString);
            Assert.Equal(model.SomeInt, actualModel.SomeInt);
            Assert.Equal(model.SomeBoolean, actualModel.SomeBoolean);
        }
示例#3
0
 public EchoModel PostBinderTHISISSHIT(EchoModel echoModel)
 {
     return(echoModel);
 }
        public EchoModel PostBinderTHISISSHIT(EchoModel echoModel)
        {

            return echoModel;
        }