private async Task <ApiWorkerResponseModel> CreateRecord()
        {
            var model = new ApiWorkerRequestModel();

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

            result.Success.Should().BeTrue();
            return(result.Record);
        }
Beispiel #2
0
        public void MapModelToBO()
        {
            var mapper = new BOLWorkerMapper();
            ApiWorkerRequestModel model = new ApiWorkerRequestModel();

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

            response.CommunicationStyle.Should().Be("A");
            response.Fingerprint.Should().Be("A");
            response.IsDisabled.Should().Be(true);
            response.JSON.Should().Be("A");
            response.MachinePolicyId.Should().Be("A");
            response.Name.Should().Be("A");
            response.RelatedDocumentIds.Should().Be("A");
            response.Thumbprint.Should().Be("A");
            response.WorkerPoolIds.Should().Be("A");
        }
        public void CreatePatch()
        {
            var mapper = new ApiWorkerModelMapper();
            var model  = new ApiWorkerRequestModel();

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

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

            patch.ApplyTo(response);
            response.CommunicationStyle.Should().Be("A");
            response.Fingerprint.Should().Be("A");
            response.IsDisabled.Should().Be(true);
            response.JSON.Should().Be("A");
            response.MachinePolicyId.Should().Be("A");
            response.Name.Should().Be("A");
            response.RelatedDocumentIds.Should().Be("A");
            response.Thumbprint.Should().Be("A");
            response.WorkerPoolIds.Should().Be("A");
        }