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

            bo.SetProperties(1, 1, "A", 1, "A", 1, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), "A");
            List <ApiErrorLogResponseModel> response = mapper.MapBOToModel(new List <BOErrorLog>()
            {
                { bo }
            });

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

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

            response.ErrorLine.Should().Be(1);
            response.ErrorMessage.Should().Be("A");
            response.ErrorNumber.Should().Be(1);
            response.ErrorProcedure.Should().Be("A");
            response.ErrorSeverity.Should().Be(1);
            response.ErrorState.Should().Be(1);
            response.ErrorTime.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.UserName.Should().Be("A");
        }
示例#3
0
        public void MapBOToModel()
        {
            var        mapper = new BOLErrorLogMapper();
            BOErrorLog bo     = new BOErrorLog();

            bo.SetProperties(1, 1, "A", 1, "A", 1, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), "A");
            ApiErrorLogResponseModel response = mapper.MapBOToModel(bo);

            response.ErrorLine.Should().Be(1);
            response.ErrorLogID.Should().Be(1);
            response.ErrorMessage.Should().Be("A");
            response.ErrorNumber.Should().Be(1);
            response.ErrorProcedure.Should().Be("A");
            response.ErrorSeverity.Should().Be(1);
            response.ErrorState.Should().Be(1);
            response.ErrorTime.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.UserName.Should().Be("A");
        }
示例#4
0
        public void MapEFToBO()
        {
            var      mapper = new DALErrorLogMapper();
            ErrorLog entity = new ErrorLog();

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

            BOErrorLog response = mapper.MapEFToBO(entity);

            response.ErrorLine.Should().Be(1);
            response.ErrorLogID.Should().Be(1);
            response.ErrorMessage.Should().Be("A");
            response.ErrorNumber.Should().Be(1);
            response.ErrorProcedure.Should().Be("A");
            response.ErrorSeverity.Should().Be(1);
            response.ErrorState.Should().Be(1);
            response.ErrorTime.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.UserName.Should().Be("A");
        }