public void Should_Throw_If_Password_Is_WhiteSpace()
            {
                // Given / When
                var result = Record.Exception(() => AuthenticationProvider.AuthenticationBasic("foo", " "));

                // Then
                result.IsArgumentOutOfRangeException("password");
            }
            public void Should_Return_AzureDevOpsBasicCredentials_Object()
            {
                // Given / When
                var credentials = AuthenticationProvider.AuthenticationBasic("foo", "bar");

                // Then
                credentials.ShouldBeOfType <AzureDevOpsBasicCredentials>();
            }
            public void Should_Throw_If_Password_Is_Null()
            {
                // Given / When
                var result = Record.Exception(() => AuthenticationProvider.AuthenticationBasic("foo", null));

                // Then
                result.IsArgumentNullException("password");
            }
            public void Should_Throw_If_User_Name_Is_WhiteSpace()
            {
                // Given / When
                var result = Record.Exception(() => AuthenticationProvider.AuthenticationBasic(" ", "foo"));

                // Then
                result.IsArgumentOutOfRangeException("userName");
            }
            public void Should_Throw_If_User_Name_Is_Null()
            {
                // Given / When
                var result = Record.Exception(() => AuthenticationProvider.AuthenticationBasic(null, "foo"));

                // Then
                result.IsArgumentNullException("userName");
            }
        public static IAzureDevOpsCredentials AzureDevOpsAuthenticationBasic(
            this ICakeContext context,
            string userName,
            string password)
        {
            context.NotNull(nameof(context));
            userName.NotNullOrWhiteSpace(nameof(userName));
            password.NotNullOrWhiteSpace(nameof(password));

            return(AuthenticationProvider.AuthenticationBasic(userName, password));
        }
            public void Should_Set_User_Name()
            {
                // Given
                const string userName = "******";

                // When
                var credentials = AuthenticationProvider.AuthenticationBasic(userName, "bar");

                // Then
                credentials.ShouldBeOfType <AzureDevOpsBasicCredentials>();
                ((AzureDevOpsBasicCredentials)credentials).UserName.ShouldBe(userName);
            }
            public void Should_Set_Password()
            {
                // Given
                const string password = "******";

                // When
                var credentials = AuthenticationProvider.AuthenticationBasic("foo", password);

                // Then
                credentials.ShouldBeOfType <AzureDevOpsBasicCredentials>();
                ((AzureDevOpsBasicCredentials)credentials).Password.ShouldBe(password);
            }