示例#1
0
            public void ShouldThrowIfFixieRunnerWasNotFound()
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture();

                fixture.GivenDefaultToolDoNotExist();

                // When, Then
                Assert.Throws <CakeException>(() => fixture.Run(), "Wyam: Could not locate executable.");
            }
示例#2
0
            public void ShouldThrowIfProcessWasNotStarted()
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture();

                fixture.GivenProcessCannotStart();

                // When, Then
                Assert.Throws <CakeException>(() => fixture.Run(), "Wyam: Process was not started.");
            }
示例#3
0
            public void ShouldThrowIfProcessHasANonZeroExitCode()
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture();

                fixture.GivenProcessExitsWithCode(1);

                // When, Then
                Assert.Throws <CakeException>(() => fixture.Run(), "Wyam: Process returned an error.");
            }
示例#4
0
            public void ShouldFindWyamRunnerIfToolPathNotProvided()
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture();

                // When
                ToolFixtureResult result = fixture.Run();

                // Then
                Assert.AreEqual("/Working/tools/Wyam.exe", result.Path.FullPath);
            }
示例#5
0
            public void ShouldSetWorkingDirectory()
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture();

                // When
                ToolFixtureResult result = fixture.Run();

                // Then
                Assert.AreEqual("/Working", result.Process.WorkingDirectory.FullPath);
            }
示例#6
0
            public void ShouldSetWorkingPathAsRootPathIfNoneSpecified()
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture();

                // When
                ToolFixtureResult result = fixture.Run();

                // Then
                Assert.AreEqual("\"/Working\"", result.Args);
            }
示例#7
0
            public void ShouldSetNoCleanFlag()
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture {
                    Settings = { NoClean = true }
                };

                // When
                ToolFixtureResult result = fixture.Run();

                // Then
                Assert.AreEqual("--noclean \"/Working\"", result.Args);
            }
示例#8
0
            public void ShouldSetPreviewFlagAndPort()
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture {
                    Settings = { Preview = true, PreviewPort = 5081 }
                };

                // When
                ToolFixtureResult result = fixture.Run();

                // Then
                Assert.AreEqual("--preview 5081 \"/Working\"", result.Args);
            }
示例#9
0
            public void ShouldSetPackagesPath()
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture {
                    Settings = { PackagesPath = "C:/temp" }
                };

                // When
                ToolFixtureResult result = fixture.Run();

                // Then
                Assert.AreEqual("--packages-path \"C:/temp\" \"/Working\"", result.Args);
            }
示例#10
0
            public void ShouldSetUseLocalPackagesFlag()
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture {
                    Settings = { UseLocalPackages = true }
                };

                // When
                ToolFixtureResult result = fixture.Run();

                // Then
                Assert.AreEqual("--use-local-packages \"/Working\"", result.Args);
            }
示例#11
0
            public void ShouldSetConfigurationFile()
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture {
                    Settings = { ConfigurationFile = "C:/temp/config.wyam" }
                };

                // When
                ToolFixtureResult result = fixture.Run();

                // Then
                Assert.AreEqual("--config \"C:/temp/config.wyam\" \"/Working\"", result.Args);
            }
示例#12
0
            public void ShouldSetVerboseFlag()
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture {
                    Settings = { Verbose = true }
                };

                // When
                ToolFixtureResult result = fixture.Run();

                // Then
                Assert.AreEqual("--verbose \"/Working\"", result.Args);
            }
示例#13
0
            public void ShouldSetOutputScriptFlag()
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture {
                    Settings = { OutputScript = true }
                };

                // When
                ToolFixtureResult result = fixture.Run();

                // Then
                Assert.AreEqual("--output-script \"/Working\"", result.Args);
            }
示例#14
0
            public void ShouldSetPreviewFlagAndForceExtensions()
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture {
                    Settings = { Preview = true, PreviewForceExtensions = true }
                };

                // When
                ToolFixtureResult result = fixture.Run();

                // Then
                Assert.AreEqual("--preview 5080 --force-ext \"/Working\"", result.Args);
            }
示例#15
0
            public void ShouldSetRelativeRootPath()
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture {
                    Settings = { RootPath = "a/b" }
                };

                // When
                ToolFixtureResult result = fixture.Run();

                // Then
                Assert.AreEqual("\"/Working/a/b\"", result.Args);
            }
示例#16
0
            public void ShouldSetLogFilePath()
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture {
                    Settings = { LogFilePath = @"/temp/log.txt" }
                };

                // When
                ToolFixtureResult result = fixture.Run();

                // Then
                Assert.AreEqual("--log \"/temp/log.txt\" \"/Working\"", result.Args);
            }
示例#17
0
            public void ShouldUseWyamRunnerFromToolPathIfProvidedOnWindows(string toolPath, string expected)
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture {
                    Settings = { ToolPath = toolPath }
                };

                fixture.GivenSettingsToolPathExist();

                // When
                ToolFixtureResult result = fixture.Run();

                // Then
                Assert.AreEqual(expected, result.Path.FullPath);
            }
示例#18
0
            public void ShouldSetInputPaths()
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture
                {
                    Settings =
                    {
                        InputPaths = new DirectoryPath[] { "C:/temp" }
                    }
                };

                // When
                ToolFixtureResult result = fixture.Run();

                // Then
                Assert.AreEqual("--input \"C:/temp\" \"/Working\"", result.Args);
            }
示例#19
0
            public void ShouldSetPreviewRoot()
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture
                {
                    Settings =
                    {
                        Preview     = true,
                        PreviewRoot = "PreviewRoot"
                    }
                };

                // When
                ToolFixtureResult result = fixture.Run();

                // Then
                Assert.AreEqual("--preview 5080 --preview-root \"PreviewRoot\" \"/Working\"", result.Args);
            }
示例#20
0
            public void ShouldSetPreviewFlagAndPortAndForceExtensionsAndPreviewRoot()
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture
                {
                    Settings =
                    {
                        Preview                = true,
                        PreviewPort            = 5081,
                        PreviewForceExtensions = true,
                        PreviewRoot            = "PreviewRoot"
                    }
                };

                // When
                ToolFixtureResult result = fixture.Run();

                // Then
                Assert.AreEqual("--preview 5081 --force-ext --preview-root \"PreviewRoot\" \"/Working\"", result.Args);
            }
示例#21
0
            public void ShouldSetGlobalMetadata()
            {
                // Given
                WyamRunnerFixture fixture = new WyamRunnerFixture
                {
                    Settings =
                    {
                        GlobalMetadata = new Dictionary <string, string>
                        {
                            { "A", "a" },
                            { "B", "C" }
                        }
                    }
                };

                // When
                ToolFixtureResult result = fixture.Run();

                // Then
                Assert.AreEqual("--global \"A=a\" --global \"B=C\" \"/Working\"", result.Args);
            }