public void Should_Redirect_Standard_Error()
            {
                var fixture = new NpmRebuilderFixture();

                fixture.Settings.RedirectStandardError = true;

                var result = fixture.Run();

                Assert.True(result.Process.RedirectStandardError);
            }
            public void Should_Throw_If_Scope_Does_Not_Start_With_At()
            {
                // Given
                var fixture = new NpmRebuilderFixture();

                // When
                var result = Record.Exception(() => fixture.Settings.AddScopedPackage("foo", "bar"));

                // Then
                Assert.IsType <ArgumentException>(result);
            }
            public void Should_Add_Mandatory_Arguments()
            {
                // Given
                var fixture = new NpmRebuilderFixture();

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

                // Then
                Assert.Equal("rebuild", result.Args);
            }
            public void Should_Add_Scoped_Package_To_Arguments()
            {
                // Given
                var fixture = new NpmRebuilderFixture();

                fixture.Settings.AddScopedPackage("foo", "@bar");

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

                // Then
                Assert.Equal("rebuild @bar/foo", result.Args);
            }
            public void Should_Throw_If_Settings_Are_Null()
            {
                // Given
                var fixture = new NpmRebuilderFixture {
                    Settings = null
                };

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

                // Then
                result.IsArgumentNullException("settings");
            }
            public void Should_Use_Cake_LogLevel_If_LogLevel_Is_Set_To_Default(
                Verbosity verbosity,
                string expected)
            {
                // Given
                var fixture = new NpmRebuilderFixture();

                fixture.Settings.CakeVerbosityLevel = verbosity;

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

                // Then
                Assert.Equal(expected, result.Args);
            }
            public void Should_Add_LogLevel_To_Arguments_If_Not_Null(
                NpmLogLevel logLevel,
                string expected)
            {
                // Given
                var fixture = new NpmRebuilderFixture();

                fixture.Settings.LogLevel = logLevel;

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

                // Then
                Assert.Equal(expected, result.Args);
            }