public void MapResponseToRequest()
        {
            var mapper = new ApiVersionInfoModelMapper();
            var model  = new ApiVersionInfoResponseModel();

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

            response.AppliedOn.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Description.Should().Be("A");
        }
Esempio 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());

            ApiVersionInfoResponseModel model = await client.VersionInfoGetAsync(1);

            ApiVersionInfoModelMapper mapper = new ApiVersionInfoModelMapper();

            UpdateResponse <ApiVersionInfoResponseModel> updateResponse = await client.VersionInfoUpdateAsync(model.Version, mapper.MapResponseToRequest(model));

            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();
        }
Esempio n. 3
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiVersionInfoModelMapper mapper = new ApiVersionInfoModelMapper();

            UpdateResponse <ApiVersionInfoResponseModel> updateResponse = await this.Client.VersionInfoUpdateAsync(model.Version, mapper.MapResponseToRequest(model));

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

            await this.Cleanup();
        }