示例#1
0
        public void MapBOToModelList()
        {
            var        mapper = new BOLDocumentMapper();
            BODocument bo     = new BODocument();

            bo.SetProperties(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), 1, BitConverter.GetBytes(1), 1, "A", "A", "A", true, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, "A", 1, "A");
            List <ApiDocumentResponseModel> response = mapper.MapBOToModel(new List <BODocument>()
            {
                { bo }
            });

            response.Count.Should().Be(1);
        }
示例#2
0
        public void MapModelToBO()
        {
            var mapper = new BOLDocumentMapper();
            ApiDocumentRequestModel model = new ApiDocumentRequestModel();

            model.SetProperties(1, BitConverter.GetBytes(1), 1, "A", "A", "A", true, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, "A", 1, "A");
            BODocument response = mapper.MapModelToBO(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), model);

            response.ChangeNumber.Should().Be(1);
            response.Document1.Should().BeEquivalentTo(BitConverter.GetBytes(1));
            response.DocumentLevel.Should().Be(1);
            response.DocumentSummary.Should().Be("A");
            response.FileExtension.Should().Be("A");
            response.FileName.Should().Be("A");
            response.FolderFlag.Should().Be(true);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Owner.Should().Be(1);
            response.Revision.Should().Be("A");
            response.Status.Should().Be(1);
            response.Title.Should().Be("A");
        }
示例#3
0
        public void MapBOToEF()
        {
            var mapper = new DALDocumentMapper();
            var bo     = new BODocument();

            bo.SetProperties(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), 1, BitConverter.GetBytes(1), 1, "A", "A", "A", true, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, "A", 1, "A");

            Document response = mapper.MapBOToEF(bo);

            response.ChangeNumber.Should().Be(1);
            response.Document1.Should().BeEquivalentTo(BitConverter.GetBytes(1));
            response.DocumentLevel.Should().Be(1);
            response.DocumentSummary.Should().Be("A");
            response.FileExtension.Should().Be("A");
            response.FileName.Should().Be("A");
            response.FolderFlag.Should().Be(true);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Owner.Should().Be(1);
            response.Revision.Should().Be("A");
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.Status.Should().Be(1);
            response.Title.Should().Be("A");
        }