예제 #1
0
 public UnitOfWork(MyResumeContext context)
 {
     _context    = context;
     Experiences = new ExperienceRepository(_context);
     Skills      = new SkillRepository(_context);
     MyProfile   = new MyProfileRepository(_context);
 }
예제 #2
0
        public void GetExperienceDetailsForEmployer_Works()
        {
            var employer = Guid.NewGuid().ToString();

            var experienceEntity = new ExperienceEntity
            {
                Employer = employer,
                Details  = new List <string> {
                    "1", "2", "3", "4", "5"
                }
            };

            var mock = new Mock <IExperienceXMLService>();

            mock.Setup(T => T.GetAll()).Returns(new List <IExperienceEntity> {
                experienceEntity
            });

            var repos = new ExperienceRepository(mock.Object, new VitaeNinjectKernel());

            var list = repos.GetExperienceDetailsForEmployer(employer);

            Assert.IsNotNull(list);
            Assert.AreEqual(5, list.Count);
            Assert.AreEqual(employer, list[2].Employer);
            Assert.AreEqual("3", list[2].ExperienceDetail);
        }
예제 #3
0
        public UnitOfWork(ApplicationDbContext db)
        {
            _db = db;

            Education  = new EducationRepository(_db);
            Experience = new ExperienceRepository(_db);
            User       = new UserRepository(_db);
        }
    public void Update(Level level)
    {
        PlayerPrefs.SetInt("level", level.getLevel());

        ExperienceRepository experienceRepository = new ExperienceRepository();

        experienceRepository.Update(level.getExperience());
    }
예제 #5
0
        public void ExperienceRepository_ImplementsTheRightInterfaces()
        {
            var mockXml    = new Mock <IExperienceXMLService>();
            var mockKernel = new Mock <IKernel>();
            var repos      = new ExperienceRepository(mockXml.Object, new VitaeNinjectKernel());

            Assert.IsTrue(repos is IExperienceRepository);
            Assert.IsTrue(repos is IRepository <IExperienceEntity>);
        }
예제 #6
0
        public void ExperienceRepository_Remove_Works()
        {
            Guid guid       = Guid.NewGuid();
            var  mockXml    = new Mock <IExperienceXMLService>();
            var  mockKernel = new Mock <IKernel>();
            var  repos      = new ExperienceRepository(mockXml.Object, new VitaeNinjectKernel());

            repos.Remove(guid);

            Assert.IsTrue(true);
        }
    public Level findById(int id)
    {
        int level = PlayerPrefs.GetInt("level", 0);

        ExperienceRepository experienceRepository = new ExperienceRepository();
        Experience           experience           = experienceRepository.findById(id, level);

        Level levelInstance = new Level(id, level, experience);

        return(levelInstance);
    }
예제 #8
0
        public void ExperienceRepository_Update_Works()
        {
            var guid = Guid.NewGuid();
            ExperienceEntity entity = new ExperienceEntity();
            var mockXml             = new Mock <IExperienceXMLService>();
            var repos = new ExperienceRepository(mockXml.Object, new VitaeNinjectKernel());

            repos.Update(guid, entity);

            Assert.IsTrue(true);
        }
예제 #9
0
        public void InsertExperienceLab(List <Experience> experiences)
        {
            ExperienceRepository <Experience> exprepo = new ExperienceRepository <Experience>();

            foreach (var expe in experiences)
            {
                if (!string.IsNullOrEmpty(expe.Company))
                {
                    exprepo.Insert(expe);
                }
            }
        }
예제 #10
0
 public UnitOfWork()
 {
     _context = new ApplicationDbContext();
     Projects = new ProjectRepository(_context);
     Practices = new PracticeRepository(_context);
     Users = new UserRepository(_context);
     PracticeUsers = new PracticeUserRepository(_context);
     Features = new FeatureRepository(_context);
     FeatureUsers = new FeatureUserRepository(_context);
     Experiences = new ExperienceRepository(_context);
     Communications = new CommunicationRespository(_context);
     Countries = new CountryRepository(_context);
 }
예제 #11
0
 public UnitOfWork()
 {
     _context       = new ApplicationDbContext();
     Projects       = new ProjectRepository(_context);
     Practices      = new PracticeRepository(_context);
     Users          = new UserRepository(_context);
     PracticeUsers  = new PracticeUserRepository(_context);
     Features       = new FeatureRepository(_context);
     FeatureUsers   = new FeatureUserRepository(_context);
     Experiences    = new ExperienceRepository(_context);
     Communications = new CommunicationRespository(_context);
     Countries      = new CountryRepository(_context);
 }
예제 #12
0
        public void ExperienceRepository_Add_Works()
        {
            var entity     = new ExperienceEntity();
            var guid       = Guid.NewGuid();
            var mockXml    = new Mock <IExperienceXMLService>();
            var mockKernel = new Mock <IKernel>();

            mockXml.Setup(T => T.Insert(entity)).Returns(guid);
            var repos = new ExperienceRepository(mockXml.Object, new VitaeNinjectKernel());

            Guid newGuid = repos.Add(entity);

            Assert.IsNotNull(newGuid);
            Assert.AreEqual(guid, newGuid);
        }
예제 #13
0
        public void ExperienceRepository_Get_Works()
        {
            var original = new ExperienceEntity();

            original.Employer = "test";
            var guid       = Guid.NewGuid();
            var mockXml    = new Mock <IExperienceXMLService>();
            var mockKernel = new Mock <IKernel>();

            mockXml.Setup(T => T.Get(guid)).Returns(original);
            var repos = new ExperienceRepository(mockXml.Object, new VitaeNinjectKernel());

            var itemReturned = repos.Get(guid);

            Assert.IsNotNull(itemReturned);
            Assert.AreEqual(original.Employer, itemReturned.Employer);
        }
예제 #14
0
파일: SUser.cs 프로젝트: Yac-Mc/ZonaFLGit
        public bool InsertExperienceLab(List <ZonaFl.Persistence.Entities.Experience> experiences)
        {
            UserRepository userrepo = new UserRepository();
            ExperienceRepository <Experience> exprepo = new ExperienceRepository <Experience>();
            var expact = userrepo.GetExperienceLabByUser(experiences.FirstOrDefault().UserId);

            foreach (var exp in expact)
            {
                exprepo.Delete(exp.Id);
            }
            try
            {
                userrepo.InsertExperienceLab(experiences);
            }
            catch (Exception er)
            {
                return(false);
            }

            return(true);
        }
예제 #15
0
        public void ExperienceRepository_GetAll_Works()
        {
            var originalList = new List <IExperienceEntity>();

            for (int i = 0; i < 42; i++)
            {
                var item = new ExperienceEntity();
                item.Employer = "test";
                originalList.Add(item);
            }
            var mockXml    = new Mock <IExperienceXMLService>();
            var mockKernel = new Mock <IKernel>();

            mockXml.Setup(T => T.GetAll()).Returns(originalList);
            var repos = new ExperienceRepository(mockXml.Object, new VitaeNinjectKernel());

            var list = repos.GetAll();

            Assert.IsNotNull(list);
            Assert.AreEqual(42, list.Count);
            Assert.IsTrue(list.All(T => T.Employer == "test"));
        }
예제 #16
0
        public void GetAllExperienceItems_Works()
        {
            var list = new List <IExperienceEntity>();

            for (int i = 0; i < 34; i++)
            {
                list.Add(new ExperienceEntity {
                    Details = new List <string> {
                        "asdf", "sdf"
                    }
                });
            }
            var mockXml = new Mock <IExperienceXMLService>();

            mockXml.Setup(T => T.GetAll()).Returns(list);

            var repos = new ExperienceRepository(mockXml.Object, new VitaeNinjectKernel());

            var newList = repos.GetAllExperienceItems();

            Assert.IsNotNull(newList);
            Assert.AreEqual(34 * 2, newList.Count);
        }
예제 #17
0
 public EmployerController(JobseekerRepository jobseekerRepository, EmployerRepository employerRepository, CompanyRepository companyRepository, ExperienceRepository experienceRepository, UserRepository userRepository)
     : base(userRepository, experienceRepository)
 {
     this.employerRepository  = employerRepository;
     this.companyRepository   = companyRepository;
     this.jobseekerRepository = jobseekerRepository;
 }
예제 #18
0
        public IEnumerable <Experience> GetExperienceLabByUser(string iduser)
        {
            ExperienceRepository <Experience> exprepo = new ExperienceRepository <Experience>();

            return(exprepo.GetList(" Where UserId = '" + iduser + "'"));
        }
예제 #19
0
 public BaseController(UserRepository userRepository, ExperienceRepository experienceRepository)
 {
     this.userRepository       = userRepository;
     this.experienceRepository = experienceRepository;
 }
예제 #20
0
 public JobseekerController(EmployerRepository employerRepository, JobseekerRepository jobseekerRepository, ExperienceRepository experienceRepository, BinaryFileRepository fileRepository,
                            UserRepository userRepository) : base(userRepository, experienceRepository)
 {
     this.jobseekerRepository  = jobseekerRepository;
     this.employerRepository   = employerRepository;
     this.experienceRepository = experienceRepository;
     this.fileRepository       = fileRepository;
 }
예제 #21
0
 public PortfolioController()
 {
     _projectRepository    = new ProjectRepository();
     _experienceRepository = new ExperienceRepository();
 }
예제 #22
0
 public ExperiencePostController()
 {
     db = new ApplicationDbContext();
     _experienceRepository = new ExperienceRepository(db);
     _unitOfWork           = new UnitOfWork(db);
 }
예제 #23
0
 public AdminController(EmployerRepository employerRepository, UserRepository userRepository,/* UserManager userManager, */
                        ExperienceRepository experienceRepository) : base(userRepository, experienceRepository)
 {
     this.employerRepository = employerRepository;
     this.userRepository     = userRepository;
 }