示例#1
0
        public virtual ApiArtifactResponseModel MapBOToModel(
            BOArtifact boArtifact)
        {
            var model = new ApiArtifactResponseModel();

            model.SetProperties(boArtifact.Id, boArtifact.Created, boArtifact.EnvironmentId, boArtifact.Filename, boArtifact.JSON, boArtifact.ProjectId, boArtifact.RelatedDocumentIds, boArtifact.TenantId);

            return(model);
        }
        public void MapResponseToRequest()
        {
            var mapper = new ApiArtifactModelMapper();
            var model  = new ApiArtifactResponseModel();

            model.SetProperties("A", DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", "A", "A", "A", "A", "A");
            ApiArtifactRequestModel response = mapper.MapResponseToRequest(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");
        }