@@ -39,20 +39,20 @@ func TestUserListIsUserOrgOwner(t *testing.T) {
3939 assert .NoError (t , PrepareTestDatabase ())
4040 tt := []struct {
4141 orgid int64
42- expected [ ]bool
42+ expected map [ int64 ]bool
4343 }{
44- {3 , [ ]bool {true , false }},
45- {6 , [ ]bool {true }},
46- {7 , [ ]bool {true }},
47- {25 , [ ]bool {true }},
44+ {3 , map [ int64 ]bool {2 : true , 4 : false }},
45+ {6 , map [ int64 ]bool {5 : true }},
46+ {7 , map [ int64 ]bool {5 : true }},
47+ {25 , map [ int64 ]bool {24 : true }},
4848 }
4949 for _ , v := range tt {
5050 t .Run (fmt .Sprintf ("IsUserOrgOwnerOfOrdIg%d" , v .orgid ), func (t * testing.T ) {
5151 testUserListIsUserOrgOwner (t , v .orgid , v .expected )
5252 })
5353 }
5454}
55- func testUserListIsUserOrgOwner (t * testing.T , orgID int64 , expected [ ]bool ) {
55+ func testUserListIsUserOrgOwner (t * testing.T , orgID int64 , expected map [ int64 ]bool ) {
5656 org , err := GetUserByID (orgID )
5757 assert .NoError (t , err )
5858 assert .NoError (t , org .GetMembers ())
@@ -63,23 +63,23 @@ func TestUserListIsTwoFaEnrolled(t *testing.T) {
6363 assert .NoError (t , PrepareTestDatabase ())
6464 tt := []struct {
6565 orgid int64
66- expected [ ]bool
66+ expected map [ int64 ]bool
6767 }{
68- {3 , [ ]bool {false , false }},
69- {6 , [ ]bool {false }},
70- {7 , [ ]bool {false }},
71- {25 , [ ]bool {true }},
68+ {3 , map [ int64 ]bool {2 : false , 4 : false }},
69+ {6 , map [ int64 ]bool {5 : false }},
70+ {7 , map [ int64 ]bool {5 : false }},
71+ {25 , map [ int64 ]bool {24 : true }},
7272 }
7373 for _ , v := range tt {
7474 t .Run (fmt .Sprintf ("IsTwoFaEnrolledOfOrdIg%d" , v .orgid ), func (t * testing.T ) {
7575 testUserListIsTwoFaEnrolled (t , v .orgid , v .expected )
7676 })
7777 }
7878}
79- func testUserListIsTwoFaEnrolled (t * testing.T , orgID int64 , expected [ ]bool ) {
79+ func testUserListIsTwoFaEnrolled (t * testing.T , orgID int64 , expected map [ int64 ]bool ) {
8080 org , err := GetUserByID (orgID )
8181 assert .NoError (t , err )
8282 assert .NoError (t , org .GetMembers ())
83- assert .Equal (t , expected , org .Members .IsTwoFaEnrolled ())
83+ assert .Equal (t , expected , org .Members .GetTwoFaStatus ())
8484
8585}
0 commit comments