public void CanLoadScriptWithNullHost() { Func <Tuple <FileInfo, ScriptDescriptionModel> > selectScript = () => new Tuple <FileInfo, ScriptDescriptionModel>(new FileInfo(@"c:\temp\file.txt"), null); Action <ScriptDescriptionModel, FileInfo, ISyntaxVerifier> storeScript = (s, f, v) => { }; Func <string, IDisposable> timerFunc = s => new MockDisposable(); var command = new OpenScriptCommand(null, selectScript, storeScript, timerFunc); Assert.IsFalse(command.CanExecute(null)); }
public void CanLoadScriptWhileHostIsExecuting() { var scriptHost = new Mock <IHostScripts>(); { scriptHost.Setup(s => s.IsExecutingScript) .Returns(true); } Func <Tuple <FileInfo, ScriptDescriptionModel> > selectScript = () => new Tuple <FileInfo, ScriptDescriptionModel>(new FileInfo(@"c:\temp\file.txt"), null); Action <ScriptDescriptionModel, FileInfo, ISyntaxVerifier> storeScript = (s, f, v) => { }; Func <string, IDisposable> timerFunc = s => new MockDisposable(); var command = new OpenScriptCommand(scriptHost.Object, selectScript, storeScript, timerFunc); Assert.IsFalse(command.CanExecute(null)); }