示例#1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiSpaceFeatureModelMapper();
            var model  = new ApiSpaceFeatureResponseModel();

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

            response.Name.Should().Be("A");
        }
示例#2
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiSpaceFeatureModelMapper mapper = new ApiSpaceFeatureModelMapper();

            UpdateResponse <ApiSpaceFeatureResponseModel> updateResponse = await this.Client.SpaceFeatureUpdateAsync(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());

            ApiSpaceFeatureResponseModel model = await client.SpaceFeatureGetAsync(1);

            ApiSpaceFeatureModelMapper mapper = new ApiSpaceFeatureModelMapper();

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

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