@@ -53,13 +53,13 @@ public void RendersNothingIfNotAuthorized()
53
53
}
54
54
55
55
[ Fact ]
56
- public void RendersNotAuthorizedContentIfNotAuthorized ( )
56
+ public void RendersNotAuthorizedIfNotAuthorized ( )
57
57
{
58
58
// Arrange
59
59
var authorizationService = new TestAuthorizationService ( ) ;
60
60
var renderer = CreateTestRenderer ( authorizationService ) ;
61
61
var rootComponent = WrapInAuthorizeView (
62
- notAuthorizedContent :
62
+ notAuthorized :
63
63
context => builder => builder . AddContent ( 0 , $ "You are not authorized, even though we know you are { context . User . Identity . Name } ") ) ;
64
64
rootComponent . AuthenticationState = CreateAuthenticationState ( "Nellie" ) ;
65
65
@@ -88,7 +88,7 @@ public void RendersNotAuthorizedContentIfNotAuthorized()
88
88
}
89
89
90
90
[ Fact ]
91
- public void RendersNothingIfAuthorizedButNoChildContentOrAuthorizedContentProvided ( )
91
+ public void RendersNothingIfAuthorizedButNoChildContentOrAuthorizedProvided ( )
92
92
{
93
93
// Arrange
94
94
var authorizationService = new TestAuthorizationService ( ) ;
@@ -152,14 +152,14 @@ public void RendersChildContentIfAuthorized()
152
152
}
153
153
154
154
[ Fact ]
155
- public void RendersAuthorizedContentIfAuthorized ( )
155
+ public void RendersAuthorizedIfAuthorized ( )
156
156
{
157
157
// Arrange
158
158
var authorizationService = new TestAuthorizationService ( ) ;
159
159
authorizationService . NextResult = AuthorizationResult . Success ( ) ;
160
160
var renderer = CreateTestRenderer ( authorizationService ) ;
161
161
var rootComponent = WrapInAuthorizeView (
162
- authorizedContent : context => builder =>
162
+ authorized : context => builder =>
163
163
builder . AddContent ( 0 , $ "You are authenticated as { context . User . Identity . Name } ") ) ;
164
164
rootComponent . AuthenticationState = CreateAuthenticationState ( "Nellie" ) ;
165
165
@@ -235,13 +235,13 @@ public void RespondsToChangeInAuthorizationState()
235
235
}
236
236
237
237
[ Fact ]
238
- public void ThrowsIfBothChildContentAndAuthorizedContentProvided ( )
238
+ public void ThrowsIfBothChildContentAndAuthorizedProvided ( )
239
239
{
240
240
// Arrange
241
241
var authorizationService = new TestAuthorizationService ( ) ;
242
242
var renderer = CreateTestRenderer ( authorizationService ) ;
243
243
var rootComponent = WrapInAuthorizeView (
244
- authorizedContent : context => builder => { } ,
244
+ authorized : context => builder => { } ,
245
245
childContent : context => builder => { } ) ;
246
246
247
247
// Act/Assert
@@ -260,7 +260,7 @@ public void RendersNothingUntilAuthorizationCompleted()
260
260
var renderer = CreateTestRenderer ( authorizationService ) ;
261
261
renderer . OnUpdateDisplayComplete = ( ) => { @event . Set ( ) ; } ;
262
262
var rootComponent = WrapInAuthorizeView (
263
- notAuthorizedContent :
263
+ notAuthorized :
264
264
context => builder => builder . AddContent ( 0 , "You are not authorized" ) ) ;
265
265
var authTcs = new TaskCompletionSource < AuthenticationState > ( ) ;
266
266
rootComponent . AuthenticationState = authTcs . Task ;
@@ -293,7 +293,7 @@ public void RendersNothingUntilAuthorizationCompleted()
293
293
}
294
294
295
295
[ Fact ]
296
- public void RendersAuthorizingContentUntilAuthorizationCompleted ( )
296
+ public void RendersAuthorizingUntilAuthorizationCompleted ( )
297
297
{
298
298
// Arrange
299
299
var @event = new ManualResetEventSlim ( ) ;
@@ -302,8 +302,8 @@ public void RendersAuthorizingContentUntilAuthorizationCompleted()
302
302
var renderer = CreateTestRenderer ( authorizationService ) ;
303
303
renderer . OnUpdateDisplayComplete = ( ) => { @event . Set ( ) ; } ;
304
304
var rootComponent = WrapInAuthorizeView (
305
- authorizingContent : builder => builder . AddContent ( 0 , "Auth pending..." ) ,
306
- authorizedContent : context => builder => builder . AddContent ( 0 , $ "Hello, { context . User . Identity . Name } !") ) ;
305
+ authorizing : builder => builder . AddContent ( 0 , "Auth pending..." ) ,
306
+ authorized : context => builder => builder . AddContent ( 0 , $ "Hello, { context . User . Identity . Name } !") ) ;
307
307
var authTcs = new TaskCompletionSource < AuthenticationState > ( ) ;
308
308
rootComponent . AuthenticationState = authTcs . Task ;
309
309
@@ -447,9 +447,9 @@ public void RejectsNonemptyScheme()
447
447
448
448
private static TestAuthStateProviderComponent WrapInAuthorizeView (
449
449
RenderFragment < AuthenticationState > childContent = null ,
450
- RenderFragment < AuthenticationState > authorizedContent = null ,
451
- RenderFragment < AuthenticationState > notAuthorizedContent = null ,
452
- RenderFragment authorizingContent = null ,
450
+ RenderFragment < AuthenticationState > authorized = null ,
451
+ RenderFragment < AuthenticationState > notAuthorized = null ,
452
+ RenderFragment authorizing = null ,
453
453
string policy = null ,
454
454
string roles = null ,
455
455
object resource = null )
@@ -458,9 +458,9 @@ private static TestAuthStateProviderComponent WrapInAuthorizeView(
458
458
{
459
459
builder . OpenComponent < AuthorizeView > ( 0 ) ;
460
460
builder . AddAttribute ( 1 , nameof ( AuthorizeView . ChildContent ) , childContent ) ;
461
- builder . AddAttribute ( 2 , nameof ( AuthorizeView . Authorized ) , authorizedContent ) ;
462
- builder . AddAttribute ( 3 , nameof ( AuthorizeView . NotAuthorized ) , notAuthorizedContent ) ;
463
- builder . AddAttribute ( 4 , nameof ( AuthorizeView . Authorizing ) , authorizingContent ) ;
461
+ builder . AddAttribute ( 2 , nameof ( AuthorizeView . Authorized ) , authorized ) ;
462
+ builder . AddAttribute ( 3 , nameof ( AuthorizeView . NotAuthorized ) , notAuthorized ) ;
463
+ builder . AddAttribute ( 4 , nameof ( AuthorizeView . Authorizing ) , authorizing ) ;
464
464
builder . AddAttribute ( 5 , nameof ( AuthorizeView . Policy ) , policy ) ;
465
465
builder . AddAttribute ( 6 , nameof ( AuthorizeView . Roles ) , roles ) ;
466
466
builder . AddAttribute ( 7 , nameof ( AuthorizeView . Resource ) , resource ) ;
0 commit comments