Exemplo n.º 1
0
        public async Task read_and_write()
        {
            var numbers = new SomeNumbers
            {
                X = 3, Y = 5
            };

            var result = await HttpTesting.Scenario(_ =>
            {
                _.Post.Json(numbers).ToUrl("/sum");
                _.StatusCodeShouldBeOk();
                _.ContentTypeShouldBe("application/json");
            });

            var sum = result.ResponseBody.ReadAsJson <SumValue>();

            sum.Sum.ShouldBe(8);
        }
Exemplo n.º 2
0
 public static SumValue post_sum(SomeNumbers input)
 {
     return(new SumValue {
         Sum = input.X + input.Y
     });
 }