Example #1
0
            public void Should_Add_OutputPath_To_Arguments_If_Set()
            {
                // Given
                var fixture = new DocFxMetadataRunnerFixture
                {
                    Settings = { OutputPath = @"c:\temp\api" }
                };

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

                // Then
                Assert.Equal("metadata -o \"c:/temp/api\"", result.Args);
            }
Example #2
0
            public void Should_Add_Force_To_Arguments_If_True()
            {
                // Given
                var fixture = new DocFxMetadataRunnerFixture
                {
                    Settings = { Force = true }
                };

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

                // Then
                Assert.Equal("metadata --force", result.Args);
            }
Example #3
0
            public void Should_Not_Add_LogLevel_To_Arguments_If_Default()
            {
                // Given
                var fixture = new DocFxMetadataRunnerFixture
                {
                    Settings = { LogLevel = DocFxLogLevel.Default }
                };

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

                // Then
                Assert.Equal("metadata", result.Args);
            }
Example #4
0
            public void Should_Add_LogLevel_To_Arguments_If_Set(DocFxLogLevel logLevel, string expectedLevel)
            {
                // Given
                var fixture = new DocFxMetadataRunnerFixture
                {
                    Settings = { LogLevel = logLevel }
                };

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

                // Then
                Assert.Equal("metadata --logLevel \"" + expectedLevel + "\"", result.Args);
            }
Example #5
0
            public void Should_Throw_If_Settings_Are_Null()
            {
                // Given
                var fixture = new DocFxMetadataRunnerFixture
                {
                    Settings = null
                };

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                result.IsArgumentNullException("settings");
            }
Example #6
0
            public void Should_Add_LogPath_To_Arguments_If_Set()
            {
                // Given
                var fixture = new DocFxMetadataRunnerFixture
                {
                    Settings = { LogPath = @"c:\temp\docfx.log" }
                };

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

                // Then
                Assert.Equal("metadata -l \"c:/temp/docfx.log\"", result.Args);
            }
Example #7
0
            public void Should_Add_Project_With_Space_In_Path_To_Arguments_If_Set()
            {
                // Given
                var fixture = new DocFxMetadataRunnerFixture
                {
                    Settings = { Projects = new List <FilePath> {
                                     @"c:\foo bar\docfx.json"
                                 } }
                };

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

                // Then
                Assert.Equal("metadata \"c:/foo bar/docfx.json\"", result.Args);
            }
Example #8
0
            public void Should_Add_Multiple_Projects_To_Arguments_If_Set()
            {
                // Given
                var fixture = new DocFxMetadataRunnerFixture
                {
                    Settings =
                    {
                        Projects = new List <FilePath>
                        {
                            @"c:\temp\foo.csproj",
                            @"c:\temp\bar.csproj"
                        }
                    }
                };

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

                // Then
                Assert.Equal("metadata \"c:/temp/foo.csproj\",\"c:/temp/bar.csproj\"", result.Args);
            }