コード例 #1
0
            public void ShouldComposeScripts([Frozen] Mock <IFileSystem> fileSystem, Mock <IScriptLibraryComposer> composer)
            {
                var cmd = new ExecuteLooseScriptCommand(
                    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 void MigratesTheFileSystem(
                [Frozen] Mock <IFileSystem> fileSystem, [Frozen] Mock <IFileSystemMigrator> fileSystemMigrator)
            {
                // arrange
                var sut = new ExecuteLooseScriptCommand(
                    null,
                    null,
                    fileSystem.Object,
                    new Mock <IScriptExecutor>().Object,
                    new Mock <IScriptPackResolver>().Object,
                    new TestLogProvider(),
                    new Mock <IAssemblyResolver>().Object,
                    fileSystemMigrator.Object,
                    new Mock <IScriptLibraryComposer>().Object);

                // act
                sut.Execute();

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