public void Should_Add_Production_To_Args_If_True()
            {
                // Given
                var fixture = new NpmPruneFixture {
                    Settings = { Production = true }
                };

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

                // Then
                Assert.Equal("prune --production", result.Args);
            }
            public void Should_Throw_If_Settings_Are_Null()
            {
                // Given
                var fixture = new NpmPruneFixture();

                fixture.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 NpmPruneFixture {
                    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 NpmPruneFixture {
                    Settings = { LogLevel = logLevel }
                };

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

                // Then
                Assert.Equal(expected, result.Args);
            }
            public void Should_Add_Packages_To_Args_If_NotEmpty(params string[] packages)
            {
                // Given
                var fixture = new NpmPruneFixture {
                    Settings = new NpmPruneSettings()
                };

                foreach (var package in packages)
                {
                    fixture.Settings.AddPackage(package);
                }

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

                // Then
                Assert.Equal($"prune {string.Join(" ", packages)}", result.Args);
            }