예제 #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
파일: Run.cs 프로젝트: dbaltas/kinoscope
 public override void Delete()
 {
     Trial.Runs.Remove(this);
     Trial.Save();
 }
예제 #5
0
 public virtual void AddTrial(Trial trial)
 {
     trial.Session = this;
     Trials.Add(trial);
 }