public void Should_Return_AzureDevOpsOAuthCredentials_Object() { // Given / When var credentials = AuthenticationProvider.AuthenticationOAuth("foo"); // Then credentials.ShouldBeOfType <AzureDevOpsOAuthCredentials>(); }
public void Should_Throw_If_Access_Token_Is_Null() { // Given / When var result = Record.Exception(() => AuthenticationProvider.AuthenticationOAuth(null)); // Then result.IsArgumentNullException("accessToken"); }
public void Should_Throw_If_Access_Token_Is_WhiteSpace() { // Given / When var result = Record.Exception(() => AuthenticationProvider.AuthenticationOAuth(" ")); // Then result.IsArgumentOutOfRangeException("accessToken"); }
public static IAzureDevOpsCredentials AzureDevOpsAuthenticationOAuth( this ICakeContext context, string accessToken) { context.NotNull(nameof(context)); accessToken.NotNullOrWhiteSpace(nameof(accessToken)); return(AuthenticationProvider.AuthenticationOAuth(accessToken)); }
public void Should_Set_Access_Token() { // Given const string accessToken = "foo"; // When var credentials = AuthenticationProvider.AuthenticationOAuth(accessToken); // Then credentials.ShouldBeOfType <AzureDevOpsOAuthCredentials>(); ((AzureDevOpsOAuthCredentials)credentials).AccessToken.ShouldBe(accessToken); }