public TestBed(string protocolFilePath, [NotNull] IReportScriptOut reportScriptOut) { Out = reportScriptOut ?? throw new ArgumentNullException(nameof(reportScriptOut)); protocolFilePath = CheckFileExistsInCurrentFolderOrScriptsFolder(protocolFilePath); var protocol = (IAssayPackageProtocol)AssayPackageManager.AssayPackageManager.UnPack(protocolFilePath); if (string.IsNullOrEmpty(protocol.AssayRunDetailsFilePath) || !File.Exists(protocol.AssayRunDetailsFilePath)) { throw new Exception($"The protocol {Path.GetFullPath(protocolFilePath)} is not ready for analysis. Open it in MyAssays Analysis and save, then try again."); } var pluginsInputStorage = new PluginsInputStorage(); pluginsInputStorage.StoreAssayXml(protocol.AssayXml.OuterXml); pluginsInputStorage.LoadRunDetails(protocol.AssayRunDetailsFilePath); pluginsInputStorage.InitialiseTransformInputs(); var analysisLoggerMock = new Mock <IAnalysisLogger>(); _data = AnalysisProcessorData.Load( pluginsInputStorage.ConfigFilePath, pluginsInputStorage.RunDetailsFilePath, pluginsInputStorage.PmcFilePath, pluginsInputStorage.FieldDataFilePath, pluginsInputStorage.AssayFilePath, analysisLoggerMock.Object); In = new ReportInMock(_data); _script = new Script(); ((ScriptBase)_script).Init(In, Out); }
internal void Init([NotNull] ReportIn reportIn, [NotNull] IReportScriptOut reportOut) { In = reportIn ?? throw new ArgumentNullException(nameof(reportIn)); Out = reportOut ?? throw new ArgumentNullException(nameof(reportOut)); }