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

            model.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, "A");
            ApiLinkLogRequestModel response = mapper.MapResponseToRequest(model);

            response.DateEntered.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.LinkId.Should().Be(1);
            response.Log.Should().Be("A");
        }
예제 #2
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiLinkLogModelMapper mapper = new ApiLinkLogModelMapper();

            UpdateResponse <ApiLinkLogResponseModel> updateResponse = await this.Client.LinkLogUpdateAsync(model.Id, mapper.MapResponseToRequest(model));

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

            await this.Cleanup();
        }
예제 #3
0
        public async void TestUpdate()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

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

            ApiLinkLogResponseModel model = await client.LinkLogGetAsync(1);

            ApiLinkLogModelMapper mapper = new ApiLinkLogModelMapper();

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

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