Beispiel #1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiChainModelMapper();
            var model  = new ApiChainResponseModel();

            model.SetProperties(1, 1, Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), "A", 1);
            ApiChainRequestModel response = mapper.MapResponseToRequest(model);

            response.ChainStatusId.Should().Be(1);
            response.ExternalId.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.Name.Should().Be("A");
            response.TeamId.Should().Be(1);
        }
Beispiel #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());

            ApiChainResponseModel model = await client.ChainGetAsync(1);

            ApiChainModelMapper mapper = new ApiChainModelMapper();

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

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

            ApiChainModelMapper mapper = new ApiChainModelMapper();

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

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

            await this.Cleanup();
        }