public UnitOfWork(MyResumeContext context) { _context = context; Experiences = new ExperienceRepository(_context); Skills = new SkillRepository(_context); MyProfile = new MyProfileRepository(_context); }
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); }
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()); }
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>); }
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); }
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); }
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); } } }
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); }
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); }
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); }
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); }
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); }
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")); }
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); }
public EmployerController(JobseekerRepository jobseekerRepository, EmployerRepository employerRepository, CompanyRepository companyRepository, ExperienceRepository experienceRepository, UserRepository userRepository) : base(userRepository, experienceRepository) { this.employerRepository = employerRepository; this.companyRepository = companyRepository; this.jobseekerRepository = jobseekerRepository; }
public IEnumerable <Experience> GetExperienceLabByUser(string iduser) { ExperienceRepository <Experience> exprepo = new ExperienceRepository <Experience>(); return(exprepo.GetList(" Where UserId = '" + iduser + "'")); }
public BaseController(UserRepository userRepository, ExperienceRepository experienceRepository) { this.userRepository = userRepository; this.experienceRepository = experienceRepository; }
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; }
public PortfolioController() { _projectRepository = new ProjectRepository(); _experienceRepository = new ExperienceRepository(); }
public ExperiencePostController() { db = new ApplicationDbContext(); _experienceRepository = new ExperienceRepository(db); _unitOfWork = new UnitOfWork(db); }
public AdminController(EmployerRepository employerRepository, UserRepository userRepository,/* UserManager userManager, */ ExperienceRepository experienceRepository) : base(userRepository, experienceRepository) { this.employerRepository = employerRepository; this.userRepository = userRepository; }