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); }
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"); }
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"); }
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"); }