예제 #1
0
        private async Task <ApiMachinePolicyResponseModel> CreateRecord()
        {
            var model = new ApiMachinePolicyRequestModel();

            model.SetProperties(true, "B", "B");
            CreateResponse <ApiMachinePolicyResponseModel> result = await this.Client.MachinePolicyCreateAsync(model);

            result.Success.Should().BeTrue();
            return(result.Record);
        }
예제 #2
0
        public void MapModelToBO()
        {
            var mapper = new BOLMachinePolicyMapper();
            ApiMachinePolicyRequestModel model = new ApiMachinePolicyRequestModel();

            model.SetProperties(true, "A", "A");
            BOMachinePolicy response = mapper.MapModelToBO("A", model);

            response.IsDefault.Should().Be(true);
            response.JSON.Should().Be("A");
            response.Name.Should().Be("A");
        }
예제 #3
0
        public void MapRequestToResponse()
        {
            var mapper = new ApiMachinePolicyModelMapper();
            var model  = new ApiMachinePolicyRequestModel();

            model.SetProperties(true, "A", "A");
            ApiMachinePolicyResponseModel response = mapper.MapRequestToResponse("A", model);

            response.Id.Should().Be("A");
            response.IsDefault.Should().Be(true);
            response.JSON.Should().Be("A");
            response.Name.Should().Be("A");
        }
예제 #4
0
        public void CreatePatch()
        {
            var mapper = new ApiMachinePolicyModelMapper();
            var model  = new ApiMachinePolicyRequestModel();

            model.SetProperties(true, "A", "A");

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

            patch.ApplyTo(response);
            response.IsDefault.Should().Be(true);
            response.JSON.Should().Be("A");
            response.Name.Should().Be("A");
        }