Пример #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);
            }