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

            model.SetProperties("A", true, "A", "A");
            ApiMachinePolicyRequestModel response = mapper.MapResponseToRequest(model);

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

            ApiMachinePolicyModelMapper mapper = new ApiMachinePolicyModelMapper();

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

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

            await this.Cleanup();
        }