Exemplo n.º 1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiPostTypeModelMapper();
            var model  = new ApiPostTypeResponseModel();

            model.SetProperties(1, "A");
            ApiPostTypeRequestModel response = mapper.MapResponseToRequest(model);

            response.Type.Should().Be("A");
        }
Exemplo n.º 2
0
        public async void TestUpdate()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

            var client = new ApiClient(testServer.CreateClient());

            ApiPostTypeResponseModel model = await client.PostTypeGetAsync(1);

            ApiPostTypeModelMapper mapper = new ApiPostTypeModelMapper();

            UpdateResponse <ApiPostTypeResponseModel> updateResponse = await client.PostTypeUpdateAsync(model.Id, mapper.MapResponseToRequest(model));

            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();
        }