public void AddTest() { JobExplorer newExplorer = new JobExplorer(); JobExplorerManager.Add(newExplorer); // Remove the inserted dummy job explorer JobExplorerManager.Delete(newExplorer); // After a JobExplorer is successfully added to the DB, the ObjectId is filled with a value by mongoDB automatically Assert.IsTrue(newExplorer.id != null); }
public void DeleteTest() { JobExplorer explorer = new JobExplorer(); JobExplorerManager.Add(explorer); JobExplorerManager.Delete(explorer); int count = JobExplorerManager.Find(x => x.id == explorer.id).Count(); Assert.IsTrue(count == 0); }
public void AddTest1() { JobExplorer explorer1 = new JobExplorer(); JobExplorer explorer2 = new JobExplorer(); List<JobExplorer> jeList = new List<JobExplorer>(); jeList.Add(explorer1); jeList.Add(explorer2); JobExplorerManager.Add(jeList as IEnumerable<JobExplorer>); JobExplorerManager.Delete(explorer1); JobExplorerManager.Delete(explorer2); Assert.IsTrue( (explorer1.id != null) && (explorer2.id != null) ); }
public static IEnumerable<EmployerSurvey> Find(JobExplorer jobExplorer) { return EmployerSurveys.AsQueryable().Where(x => jobExplorer.employerSurveys.Contains(x.id)); }
public static void Update(JobExplorer jobExplorer, UpdateDefinition<JobExplorer> update) { DBContext.Current.Update<JobExplorer>(x => x.id == jobExplorer.id, update); }
public static void Delete(JobExplorer jobExplorer) { DBContext.Current.Delete<JobExplorer>(x => x.id == jobExplorer.id); }
public static void Add(JobExplorer explorer) { DBContext.Current.Add<JobExplorer>(explorer); }
public static IEnumerable<PersonalSurvey> Find(JobExplorer jobExplorer) { return PersonalSurveys.AsQueryable().Where(x => jobExplorer.personalSurveys.Contains(x.id)); }