public virtual BOStudentXFamily MapEFToBO(
            StudentXFamily ef)
        {
            var bo = new BOStudentXFamily();

            bo.SetProperties(
                ef.Id,
                ef.FamilyId,
                ef.StudentId);
            return(bo);
        }
        public virtual StudentXFamily MapBOToEF(
            BOStudentXFamily bo)
        {
            StudentXFamily efStudentXFamily = new StudentXFamily();

            efStudentXFamily.SetProperties(
                bo.FamilyId,
                bo.Id,
                bo.StudentId);
            return(efStudentXFamily);
        }
Example #3
0
        public void MapEFToBO()
        {
            var            mapper = new DALStudentXFamilyMapper();
            StudentXFamily entity = new StudentXFamily();

            entity.SetProperties(1, 1, 1);

            BOStudentXFamily response = mapper.MapEFToBO(entity);

            response.FamilyId.Should().Be(1);
            response.Id.Should().Be(1);
            response.StudentId.Should().Be(1);
        }
Example #4
0
        public void MapBOToEF()
        {
            var mapper = new DALStudentXFamilyMapper();
            var bo     = new BOStudentXFamily();

            bo.SetProperties(1, 1, 1);

            StudentXFamily response = mapper.MapBOToEF(bo);

            response.FamilyId.Should().Be(1);
            response.Id.Should().Be(1);
            response.StudentId.Should().Be(1);
        }
Example #5
0
        public void MapEFToBOList()
        {
            var            mapper = new DALStudentXFamilyMapper();
            StudentXFamily entity = new StudentXFamily();

            entity.SetProperties(1, 1, 1);

            List <BOStudentXFamily> response = mapper.MapEFToBO(new List <StudentXFamily>()
            {
                entity
            });

            response.Count.Should().Be(1);
        }
Example #6
0
        public async void Get()
        {
            var mock   = new ServiceMockFacade <IStudentXFamilyRepository>();
            var record = new StudentXFamily();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(record));
            var service = new StudentXFamilyService(mock.LoggerMock.Object,
                                                    mock.RepositoryMock.Object,
                                                    mock.ModelValidatorMockFactory.StudentXFamilyModelValidatorMock.Object,
                                                    mock.BOLMapperMockFactory.BOLStudentXFamilyMapperMock,
                                                    mock.DALMapperMockFactory.DALStudentXFamilyMapperMock);

            ApiStudentXFamilyResponseModel response = await service.Get(default(int));

            response.Should().NotBeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>()));
        }