コード例 #1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiMachineRefTeamModelMapper();
            var model  = new ApiMachineRefTeamResponseModel();

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

            response.MachineId.Should().Be(1);
            response.TeamId.Should().Be(1);
        }
コード例 #2
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiMachineRefTeamModelMapper mapper = new ApiMachineRefTeamModelMapper();

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

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

            await this.Cleanup();
        }
コード例 #3
0
        public void CreatePatch()
        {
            var mapper = new ApiMachineRefTeamModelMapper();
            var model  = new ApiMachineRefTeamRequestModel();

            model.SetProperties(1, 1);

            JsonPatchDocument <ApiMachineRefTeamRequestModel> patch = mapper.CreatePatch(model);
            var response = new ApiMachineRefTeamRequestModel();

            patch.ApplyTo(response);
            response.MachineId.Should().Be(1);
            response.TeamId.Should().Be(1);
        }