Пример #1
0
        public virtual Run RunForTrial(Trial trial)
        {
            foreach (Run run in trial.Runs)
            {
                if (run.Subject.Code == this.Code)
                {
                    return(run);
                }
            }

            return(null);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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();
        }
Пример #4
0
 public override void Delete()
 {
     Trial.Runs.Remove(this);
     Trial.Save();
 }
Пример #5
0
 public virtual void AddTrial(Trial trial)
 {
     trial.Session = this;
     Trials.Add(trial);
 }