コード例 #1
0
        public void CanCreateNewScriptWithNullHost()
        {
            Func <Tuple <bool, ScriptDescriptionModel> >     selectScript = () => new Tuple <bool, ScriptDescriptionModel>(false, null);
            Action <ScriptDescriptionModel, ISyntaxVerifier> storeScript  = (s, v) => { };
            Func <string, IDisposable> timerFunc = s => new MockDisposable();

            var command = new NewScriptCommand(null, selectScript, storeScript, timerFunc);

            Assert.IsFalse(command.CanExecute(null));
        }
コード例 #2
0
        public void CanCreateNewScriptWhileHostIsExecuting()
        {
            var scriptHost = new Mock <IHostScripts>();
            {
                scriptHost.Setup(s => s.IsExecutingScript)
                .Returns(true);
            }

            Func <Tuple <bool, ScriptDescriptionModel> >     selectScript = () => new Tuple <bool, ScriptDescriptionModel>(false, null);
            Action <ScriptDescriptionModel, ISyntaxVerifier> storeScript  = (s, v) => { };
            Func <string, IDisposable> timerFunc = s => new MockDisposable();

            var command = new NewScriptCommand(scriptHost.Object, selectScript, storeScript, timerFunc);

            Assert.IsFalse(command.CanExecute(null));
        }