-
Notifications
You must be signed in to change notification settings - Fork 4
/
route_options_test.go
46 lines (39 loc) · 992 Bytes
/
route_options_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (c) Jim Lambert
// SPDX-License-Identifier: MIT
package gldap
import (
"testing"
"github.com/stretchr/testify/assert"
)
func Test_WithLabel(t *testing.T) {
t.Parallel()
assert := assert.New(t)
opts := getRouteOpts(WithLabel("label"))
testOpts := routeDefaults()
testOpts.withLabel = "label"
assert.Equal(opts, testOpts)
}
func Test_WithBaseDN(t *testing.T) {
t.Parallel()
assert := assert.New(t)
opts := getRouteOpts(WithBaseDN("baseDN"))
testOpts := routeDefaults()
testOpts.withBaseDN = "baseDN"
assert.Equal(opts, testOpts)
}
func Test_WithFilter(t *testing.T) {
t.Parallel()
assert := assert.New(t)
opts := getRouteOpts(WithFilter("filter"))
testOpts := routeDefaults()
testOpts.withFilter = "filter"
assert.Equal(opts, testOpts)
}
func Test_WithScope(t *testing.T) {
t.Parallel()
assert := assert.New(t)
opts := getRouteOpts(WithScope(SingleLevel))
testOpts := routeDefaults()
testOpts.withScope = SingleLevel
assert.Equal(opts, testOpts)
}