public virtual Run RunForTrial(Trial trial) { foreach (Run run in trial.Runs) { if (run.Subject.Code == this.Code) { return(run); } } return(null); }
public static Trial getLastActiveTrialForProject(Project project) { string settingName = String.Format(_NameLastActiveTrialForProjectFormat, project.Id); Settings settings = _findOneByName(settingName); if (settings != null && settings.Value != null) { return(Trial.Find(Int32.Parse(settings.Value))); } return(null); }
public static void setLastActiveTrialForProject(Trial trial) { Project project = trial.Session.BehavioralTest.Project; string settingName = String.Format(_NameLastActiveTrialForProjectFormat, project.Id); Settings settings = _findOneByName(settingName); if (settings == null) { settings = new Settings() { Name = settingName }; } settings.Value = trial != null?trial.Id.ToString() : null; settings.Save(); }
public override void Delete() { Trial.Runs.Remove(this); Trial.Save(); }
public virtual void AddTrial(Trial trial) { trial.Session = this; Trials.Add(trial); }