예제 #1
0
        public void Map_admin_persistance_collection_to_admin_entity_collection_when_collection_is_null()
        {
            List <AdminPersistence> listOfAdminPersistences = null;

            Assert.Throws <ArgumentNullException>(()
                                                  => AdminMapper.MapAdminPersistenceCollectionToAdminEntityCollection(listOfAdminPersistences));
        }
예제 #2
0
 public IEnumerable <Admin> GetAllAdmins()
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(AdminMapper.MapAdminPersistenceCollectionToAdminEntityCollection(_context.Admin.ToList()));
     }
 }
예제 #3
0
        public void Map_admin_persistances_collection_to_admin_entities_collection()
        {
            List <AdminPersistence> listOfAdminPersistences = this.GetListOfAdminPersistance();

            List <Admin> listOfAdminEntities = AdminMapper.MapAdminPersistenceCollectionToAdminEntityCollection(listOfAdminPersistences).ToList();

            Assert.True(this.IsEqualAdminPersistanceAndAdminEntity(listOfAdminPersistences[0], listOfAdminEntities[0]));
            Assert.True(this.IsEqualAdminPersistanceAndAdminEntity(listOfAdminPersistences[1], listOfAdminEntities[1]));
        }