-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathazure_models_test.go
51 lines (45 loc) · 1.1 KB
/
azure_models_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
47
48
49
50
51
package main
import (
"testing"
"github.com/stretchr/testify/require"
)
// TestAzureUser ensures that raw representation has expected value.
func TestAzureUser(t *testing.T) {
rawUser, err := AzureUser{
PrincipalName: "[email protected]",
AzureID: "fake-az-id-alice",
Email: "[email protected]",
FirstName: "Alice",
LastName: "Henderson",
DisplayName: "Henderson, Alice (ACME)",
}.GetRaw()
require.NoError(t, err)
require.Equal(
t,
map[string]any{
"principal_name": "[email protected]",
"id": "fake-az-id-alice",
"email": "[email protected]",
"first_name": "Alice",
"last_name": "Henderson",
"display_name": "Henderson, Alice (ACME)",
},
rawUser,
)
}
// TestAzureGroup ensures that raw representation has expected value.
func TestAzureGroup(t *testing.T) {
rawGroup, err := AzureGroup{
AzureID: "fake-az-acme.devs",
DisplayName: "acme.devs|all",
}.GetRaw()
require.NoError(t, err)
require.Equal(
t,
map[string]any{
"id": "fake-az-acme.devs",
"display_name": "acme.devs|all",
},
rawGroup,
)
}