@@ -196,6 +196,45 @@ public void EnsureDefaultServices()
196
196
Assert . IsType < UserManager < PocoUser > > ( provider . GetRequiredService < UserManager < PocoUser > > ( ) ) ;
197
197
}
198
198
199
+ [ Fact ]
200
+ public void EnsureDefaultSignInManagerDependenciesForIdentity ( )
201
+ {
202
+ var services = new ServiceCollection ( )
203
+ . AddSingleton < IConfiguration > ( new ConfigurationBuilder ( ) . Build ( ) ) ;
204
+ services . AddLogging ( )
205
+ . AddIdentity < PocoUser , PocoRole > ( )
206
+ . AddUserStore < NoopUserStore > ( )
207
+ . AddRoleStore < NoopRoleStore > ( )
208
+ . AddSignInManager < MySignInManager > ( ) ;
209
+
210
+ var provider = services . BuildServiceProvider ( ) ;
211
+
212
+ Assert . IsType < MySignInManager > ( provider . GetRequiredService < SignInManager < PocoUser > > ( ) ) ;
213
+ Assert . IsType < SecurityStampValidator < PocoUser > > ( provider . GetRequiredService < ISecurityStampValidator > ( ) ) ;
214
+ Assert . IsType < TwoFactorSecurityStampValidator < PocoUser > > ( provider . GetRequiredService < ITwoFactorSecurityStampValidator > ( ) ) ;
215
+ Assert . NotNull ( provider . GetService < IOptions < SecurityStampValidatorOptions > > ( ) ) ;
216
+ }
217
+
218
+ [ Fact ]
219
+ public void EnsureDefaultSignInManagerDependenciesForIdentityCore ( )
220
+ {
221
+ var services = new ServiceCollection ( )
222
+ . AddSingleton < IConfiguration > ( new ConfigurationBuilder ( ) . Build ( ) ) ;
223
+ services . AddLogging ( )
224
+ . AddIdentityCore < PocoUser > ( )
225
+ . AddRoles < PocoRole > ( )
226
+ . AddUserStore < NoopUserStore > ( )
227
+ . AddRoleStore < NoopRoleStore > ( )
228
+ . AddSignInManager < MySignInManager > ( ) ;
229
+
230
+ var provider = services . BuildServiceProvider ( ) ;
231
+
232
+ Assert . IsType < MySignInManager > ( provider . GetRequiredService < SignInManager < PocoUser > > ( ) ) ;
233
+ Assert . IsType < SecurityStampValidator < PocoUser > > ( provider . GetRequiredService < ISecurityStampValidator > ( ) ) ;
234
+ Assert . IsType < TwoFactorSecurityStampValidator < PocoUser > > ( provider . GetRequiredService < ITwoFactorSecurityStampValidator > ( ) ) ;
235
+ Assert . NotNull ( provider . GetService < IOptions < SecurityStampValidatorOptions > > ( ) ) ;
236
+ }
237
+
199
238
[ Fact ]
200
239
public void EnsureDefaultTokenProviders ( )
201
240
{
0 commit comments