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

                fixture.Settings.RedirectStandardError = true;

                var result = fixture.Run();

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

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

                // Then
                Assert.Equal("publish", result.Args);
            }
            public void Should_Add_Registry_To_Arguments_If_Not_Null()
            {
                // Given
                var fixture = new NpmPublisherFixture();

                fixture.Settings.Registry = new Uri("https://example.com");

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

                // Then
                Assert.Equal("publish --registry https://example.com/", result.Args);
            }
            public void Should_Add_Access_To_Arguments_If_Not_Default()
            {
                // Given
                var fixture = new NpmPublisherFixture();

                fixture.Settings.Access = NpmPublishAccess.Public;

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

                // Then
                Assert.Equal("publish --access public", result.Args);
            }
            public void Should_Add_Tag_To_Arguments_If_Not_Null()
            {
                // Given
                var fixture = new NpmPublisherFixture();

                fixture.Settings.Tag = "foo";

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

                // Then
                Assert.Equal("publish --tag foo", result.Args);
            }
            public void Should_Add_Source_To_Arguments_If_Not_Null()
            {
                // Given
                var fixture = new NpmPublisherFixture();

                fixture.Settings.Source = "c:\\mypackage";

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

                // Then
                Assert.Equal("publish \"c:\\mypackage\"", result.Args);
            }
            public void Should_Throw_If_Settings_Are_Null()
            {
                // Given
                var fixture = new NpmPublisherFixture();

                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 NpmPublisherFixture();

                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 NpmPublisherFixture();

                fixture.Settings.LogLevel = logLevel;

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

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