Files
threshold/internal/servers/controller/handlers/option_test.go
T
dd0f34bc35 Add new OIDC auth method. (#1090)
Co-authored-by: Todd Knight <T.Alan.Knight@gmail.com>
Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>
2021-04-08 20:54:32 -04:00

31 lines
752 B
Go

package handlers
import (
"testing"
"github.com/stretchr/testify/assert"
)
// Test_GetOpts provides unit tests for GetOpts and all the options
func Test_GetOpts(t *testing.T) {
t.Parallel()
t.Run("WithDiscardUnknownFields", func(t *testing.T) {
assert := assert.New(t)
// test default of 0
opts := getOpts()
testOpts := getDefaultOptions()
testOpts.withDiscardUnknownFields = false
assert.Equal(opts, testOpts)
opts = getOpts(WithDiscardUnknownFields(true))
testOpts = getDefaultOptions()
testOpts.withDiscardUnknownFields = true
assert.Equal(opts, testOpts)
opts = getOpts(WithDiscardUnknownFields(false))
testOpts = getDefaultOptions()
testOpts.withDiscardUnknownFields = false
assert.Equal(opts, testOpts)
})
}