@@ -207,5 +207,73 @@ public void GetCurrentIdentity(string identityName, string password)
207207
208208 Assert . Equal ( identity , res ) ;
209209 }
210+
211+ /// <summary>
212+ /// Test that the AllGroup is not null and has the expected default properties.
213+ /// </summary>
214+ [ Fact ]
215+ public void AllGroupExists ( )
216+ {
217+ // arrange
218+ var componentHub = UnitTestFixture . CreateAndRegisterComponentHubMock ( ) ;
219+ var identityManager = componentHub . IdentityManager ;
220+
221+ // act & assert
222+ Assert . NotNull ( identityManager . AllGroup ) ;
223+ Assert . Equal ( "All" , identityManager . AllGroup . Name ) ;
224+ Assert . Equal ( Guid . Empty , identityManager . AllGroup . Id ) ;
225+ }
226+
227+ /// <summary>
228+ /// Test that the AllGroup has the PublicAccess policy.
229+ /// </summary>
230+ [ Fact ]
231+ public void AllGroupHasPublicAccessPolicy ( )
232+ {
233+ // arrange
234+ var componentHub = UnitTestFixture . CreateAndRegisterComponentHubMock ( ) ;
235+ var identityManager = componentHub . IdentityManager ;
236+
237+ // act
238+ var policies = identityManager . AllGroup . Policies ;
239+
240+ // assert
241+ Assert . Contains ( typeof ( PublicAccess ) . FullName . ToLower ( ) , policies ) ;
242+ }
243+
244+ /// <summary>
245+ /// Test that the IIdentityGroup interface has the Id and Name properties.
246+ /// </summary>
247+ [ Fact ]
248+ public void IIdentityGroupHasIdAndName ( )
249+ {
250+ // arrange
251+ var group = MockIdentityFactory . GetIdentityGroup ( "Admins" ) ;
252+
253+ // act & assert
254+ Assert . NotNull ( group ) ;
255+ Assert . IsAssignableFrom < IIdentityGroup > ( group ) ;
256+ Assert . NotEqual ( Guid . Empty , group . Id ) ;
257+ Assert . Equal ( "Admins" , group . Name ) ;
258+ }
259+
260+ /// <summary>
261+ /// Test that the AllGroup has the expected name and contains the PublicAccess policy.
262+ /// </summary>
263+ [ Fact ]
264+ public void AllGroupHasExpectedProperties ( )
265+ {
266+ // arrange
267+ var componentHub = UnitTestFixture . CreateAndRegisterComponentHubMock ( ) ;
268+ var identityManager = componentHub . IdentityManager as IdentityManager ;
269+
270+ // act
271+ var allGroup = identityManager . AllGroup ;
272+
273+ // assert
274+ Assert . NotNull ( allGroup ) ;
275+ Assert . Equal ( "All" , allGroup . Name ) ;
276+ Assert . Contains ( typeof ( PublicAccess ) . FullName . ToLower ( ) , allGroup . Policies ) ;
277+ }
210278 }
211279}
0 commit comments