public void ShouldComposeScripts([Frozen] Mock <IFileSystem> fileSystem, Mock <IScriptLibraryComposer> composer)
            {
                var cmd = new ExecuteScriptCommand(
                    null,
                    null,
                    fileSystem.Object,
                    new Mock <IScriptExecutor>().Object,
                    new Mock <IScriptPackResolver>().Object,
                    new TestLogProvider(),
                    new Mock <IAssemblyResolver>().Object,
                    composer.Object);

                cmd.Execute();

                composer.Verify(c => c.Compose(It.IsAny <string>(), null));
            }
示例#2
0
        public override void ExecuteHotkey(int index)
        {
            base.ExecuteHotkey(index);
            switch (index)
            {
            case 0:
                ExecuteScriptCommand.Execute(null);
                break;

            case 1:
                StopScriptCommand.Execute(null);
                break;

            case 2:
                Variables.Clear();
                break;
            }
        }
示例#3
0
            public void MigratesTheFileSystem(
                [Frozen] Mock <IFileSystem> fileSystem, [Frozen] Mock <IFileSystemMigrator> fileSystemMigrator)
            {
                // arrange
                var sut = new ExecuteScriptCommand(
                    null,
                    null,
                    fileSystem.Object,
                    new Mock <IScriptExecutor>().Object,
                    new Mock <IScriptPackResolver>().Object,
                    new Mock <ILog>().Object,
                    new Mock <IAssemblyResolver>().Object,
                    fileSystemMigrator.Object);

                // act
                sut.Execute();

                // assert
                fileSystemMigrator.Verify(m => m.Migrate(), Times.Once);
            }