Exemplo n.º 1
0
        private async Task <ApiArtifactResponseModel> CreateRecord()
        {
            var model = new ApiArtifactRequestModel();

            model.SetProperties(DateTimeOffset.Parse("1/1/1988 12:00:00 AM"), "B", "B", "B", "B", "B", "B");
            CreateResponse <ApiArtifactResponseModel> result = await this.Client.ArtifactCreateAsync(model);

            result.Success.Should().BeTrue();
            return(result.Record);
        }
Exemplo n.º 2
0
        public void MapModelToBO()
        {
            var mapper = new BOLArtifactMapper();
            ApiArtifactRequestModel model = new ApiArtifactRequestModel();

            model.SetProperties(DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", "A", "A", "A", "A", "A");
            BOArtifact response = mapper.MapModelToBO("A", model);

            response.Created.Should().Be(DateTimeOffset.Parse("1/1/1987 12:00:00 AM"));
            response.EnvironmentId.Should().Be("A");
            response.Filename.Should().Be("A");
            response.JSON.Should().Be("A");
            response.ProjectId.Should().Be("A");
            response.RelatedDocumentIds.Should().Be("A");
            response.TenantId.Should().Be("A");
        }
        public void CreatePatch()
        {
            var mapper = new ApiArtifactModelMapper();
            var model  = new ApiArtifactRequestModel();

            model.SetProperties(DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", "A", "A", "A", "A", "A");

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

            patch.ApplyTo(response);
            response.Created.Should().Be(DateTimeOffset.Parse("1/1/1987 12:00:00 AM"));
            response.EnvironmentId.Should().Be("A");
            response.Filename.Should().Be("A");
            response.JSON.Should().Be("A");
            response.ProjectId.Should().Be("A");
            response.RelatedDocumentIds.Should().Be("A");
            response.TenantId.Should().Be("A");
        }