Exemple #1
0
        public async Task TestSuperAdminSetup()
        {
            //SETUP

            //ATTEMPT
            await _serviceProvider.CheckAddSuperAdminAsync();

            //VERIFY
            using (var extraContext = _serviceProvider.GetRequiredService <ExtraAuthorizeDbContext>())
            {
                var user = await _serviceProvider.GetRequiredService <UserManager <IdentityUser> >().FindByEmailAsync("*****@*****.**");

                user.ShouldNotBeNull();
                extraContext.RolesToPermissions.Single().RoleName.ShouldEqual("SuperAdmin");
                extraContext.UserToRoles.Single().UserId.ShouldEqual(user.Id);
            }
        }