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)); }
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; } }
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); }