public Experiment(string name, ISciencePublisher publisher, IExperimentState state, IExperimentSteps <T, TPublish> steps, bool throwOnInternalExceptions) { _name = name; _publisher = publisher; //if this is null, nothing gets published! should we throw? _throwOnInternalExceptions = throwOnInternalExceptions; _currentState = state; _steps = steps; //should be overwriten by public Set }
//ctor for testing public Laboratory(ISciencePublisher publisher, bool throwOnInternalExceptions) { if (publisher == null) { throw new ArgumentNullException("publisher"); } this.publisher = publisher; this.throwOnInternalExceptions = throwOnInternalExceptions; }
//public Laboratory(IScienceExperiment<T, TPublish> experiment, IExperimentSteps<T, TPublish> steps) //{ // if (experiment == null) throw new ArgumentNullException("experiment"); // if (steps == null) throw new ArgumentNullException("steps"); // this.experiment = experiment; // this.steps = steps; //} //public Laboratory(IScienceExperiment<T, TPublish> experiment) // : this(experiment, new ExperimentSteps<T,TPublish>()) //{ } //public Laboratory(string name) : this(name, new ConsolePublisher()) //{ } public Laboratory(ISciencePublisher publisher) : this(publisher, false) { }
public static void SetPublisher(ISciencePublisher publisher) { _publisher = publisher; }
public SimpleExperiment(string name, ISciencePublisher publisher) : base(name, publisher, false) { }
public SimpleExperiment(string name, ISciencePublisher publisher, bool raiseInternalExceptions) : base(name, publisher, raiseInternalExceptions) { }
public Experiment(string name, ISciencePublisher publisher) : this(name, publisher, false) { }
public Experiment(string name, ISciencePublisher publisher, bool throwOnInternalExceptions) : this(name, publisher, new ExperimentState(), throwOnInternalExceptions) { }
public Experiment(string name, ISciencePublisher publisher, IExperimentState state, bool throwOnInternalExceptions) : this(name, publisher, state, new ExperimentSteps <T, TPublish>(), throwOnInternalExceptions) { }