public void MapResponseToRequest()
        {
            var mapper = new ApiPipelineModelMapper();
            var model  = new ApiPipelineResponseModel();

            model.SetProperties(1, 1, 1);
            ApiPipelineRequestModel response = mapper.MapResponseToRequest(model);

            response.PipelineStatusId.Should().Be(1);
            response.SaleId.Should().Be(1);
        }
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiPipelineModelMapper mapper = new ApiPipelineModelMapper();

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

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

            await this.Cleanup();
        }
Beispiel #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());

            ApiPipelineResponseModel model = await client.PipelineGetAsync(1);

            ApiPipelineModelMapper mapper = new ApiPipelineModelMapper();

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

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