Skip to content

Commit

Permalink
Add basic auth unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
raulcabello committed Jan 12, 2024
1 parent febd18b commit 3b5f78b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions azuredevops/azuredevops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,16 @@ func TestParseBasicAuth(t *testing.T) {
assert.Nil(t, p)
}
}

func TestBasicAuth(t *testing.T) {
const user = "user"
const pass = "pass123"

opt := Options.BasicAuth(user, pass)
h := &Webhook{}
err := opt(h)

assert.NoError(t, err)
assert.Equal(t, h.username, user)
assert.Equal(t, h.password, pass)
}

0 comments on commit 3b5f78b

Please sign in to comment.