forked from kai-ten/go-csf-schemas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
actor_test.go
38 lines (33 loc) · 1007 Bytes
/
actor_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
package gcs
import "testing"
func TestValidActorObject(t *testing.T) {
actor := &Actor{
AuthorizationInformation: &[]AuthorizationInformation{},
IdentityProvider: &IdentityProvider{},
InvokedBy: "",
Process: &Process{},
User: &User{EmailAddress: "[email protected]"},
UserSession: &Session{},
}
_, err := ValidateActor(actor)
if err != nil {
t.Fatalf("Actor object should have been valid: %v", err)
}
}
func BenchmarkValidActorObject(b *testing.B) {
b.ReportAllocs()
actor := &Actor{
AuthorizationInformation: &[]AuthorizationInformation{},
IdentityProvider: &IdentityProvider{},
InvokedBy: "",
Process: &Process{},
User: &User{EmailAddress: "[email protected]"},
UserSession: &Session{},
}
for n := 0; n < b.N; n++ {
_, err := ValidateActor(actor)
if err != nil {
b.Errorf("Actor object was invalid: %v", err)
}
}
}