File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
src/Umbraco.Tests/Services Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -451,6 +451,24 @@ public void Can_Remove_Section_From_All_Assigned_Users()
451
451
452
452
}
453
453
454
+ [ Test ]
455
+ public void Can_Add_Section_To_All_Users ( )
456
+ {
457
+ var userType = ServiceContext . UserService . GetUserTypeByAlias ( "admin" ) ;
458
+
459
+ var user1 = ServiceContext . UserService . CreateUserWithIdentity ( "test1" , "test1@test.com" , userType ) ;
460
+ var user2 = ServiceContext . UserService . CreateUserWithIdentity ( "test2" , "test2@test.com" , userType ) ;
461
+
462
+ //now add the section to all users
463
+ ServiceContext . UserService . AddSectionToAllUsers ( "test" ) ;
464
+
465
+ //assert
466
+ var result1 = ServiceContext . UserService . GetUserById ( ( int ) user1 . Id ) ;
467
+ var result2 = ServiceContext . UserService . GetUserById ( ( int ) user2 . Id ) ;
468
+ Assert . IsFalse ( result1 . AllowedSections . Contains ( "test" ) ) ;
469
+ Assert . IsFalse ( result2 . AllowedSections . Contains ( "test" ) ) ;
470
+ }
471
+
454
472
[ Test ]
455
473
public void Get_By_Profile_Username ( )
456
474
{
@@ -512,4 +530,4 @@ public void Get_User_By_Username()
512
530
Assert . That ( updatedItem . AllowedSections . Count ( ) , Is . EqualTo ( 0 ) ) ;
513
531
}
514
532
}
515
- }
533
+ }
You can’t perform that action at this time.
0 commit comments