public static Project CreateDefaultEpm(Researcher researcher, String name) { if (researcher == null) { Logger.logError("Invalid Researcher"); return(null); } var project = new Project { Name = name }; var test = new BehavioralTest { Name = "test", BehavioralTestType = BehavioralTestType.Epm, }; project.AddBehavioralTest(test); Researcher.Current.AddProject(project); var testSession = new Session { Name = "", }; test.AddSession(testSession); var testTrial = new Trial { Name = "", Duration = 300, }; testSession.AddTrial(testTrial); Researcher.Current.Save(); return(project); }
public static Project CreateDefaultEpm(Researcher researcher, String name) { if (researcher == null) { Logger.logError("Invalid Researcher"); return null; } var project = new Project { Name = name }; var test = new BehavioralTest { Name = "test", BehavioralTestType = BehavioralTestType.Epm, }; project.AddBehavioralTest(test); Researcher.Current.AddProject(project); var testSession = new Session { Name = "", }; test.AddSession(testSession); var testTrial = new Trial { Name = "", Duration = 300, }; testSession.AddTrial(testTrial); Researcher.Current.Save(); return project; }
private static Project createLightFstProject() { Project project = new Project(); Researcher.Current.ActiveProject = project; //needed due to trial.populateWithRuns dependency on ActiveProject project.Name = "UnitTest Project"; Subject subject = new Subject(); subject.Code = "1"; project.AddSubject(subject); Subject subject2 = new Subject(); subject2.Code = "2"; project.AddSubject(subject2); project.Save(); fstLightTest = new BehavioralTest(); Session fstLightSession = new Session(); fstLightTrial = new Trial(); fstLightTrial.Duration = 15; fstLightTrial.Name = "T1"; fstLightTrial.PopulateWithRuns(); fstLightSession.Name = "S1"; fstLightSession.AddTrial(fstLightTrial); fstLightTest.Name = "FST light"; fstLightTest.BehavioralTestType = BehavioralTestType.Fst; fstLightTest.AddSession(fstLightSession); project.AddBehavioralTest(fstLightTest); fstTest = new BehavioralTest(); Session session = new Session(); fstTrial = new Trial(); fstTrial.Duration = 300; fstTrial.Name = "T1"; fstTrial.PopulateWithRuns(); session.Name = "S1"; session.AddTrial(fstTrial); fstTest.Name = "FST Regular"; fstTest.BehavioralTestType = BehavioralTestType.Fst; fstTest.AddSession(session); project.AddBehavioralTest(fstTest); orTest = new BehavioralTest(); Session orSession = new Session(); orTrial = new Trial(); orTrial.Duration = 100; orTrial.Name = "T1"; orTrial.PopulateWithRuns(); orSession.Name = "S1"; orSession.AddTrial(orTrial); orTest.Name = "Object Recognition"; orTest.BehavioralTestType = BehavioralTestType.ObjectRecognition; orTest.AddSession(orSession); project.AddBehavioralTest(orTest); project.Save(); return(project); }