From 3b5f78bd354ee00177c0c4ac49dfd9ca5b1dab90 Mon Sep 17 00:00:00 2001 From: raul Date: Fri, 12 Jan 2024 18:34:53 +0100 Subject: [PATCH] Add basic auth unit test --- azuredevops/azuredevops_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/azuredevops/azuredevops_test.go b/azuredevops/azuredevops_test.go index 1a6a9c3..2ff8f11 100644 --- a/azuredevops/azuredevops_test.go +++ b/azuredevops/azuredevops_test.go @@ -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) +}