예제 #1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiLinkTypeModelMapper();
            var model  = new ApiLinkTypeResponseModel();

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

            response.Type.Should().Be("A");
        }
예제 #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());

            ApiLinkTypeResponseModel model = await client.LinkTypeGetAsync(1);

            ApiLinkTypeModelMapper mapper = new ApiLinkTypeModelMapper();

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

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