Esempio n. 1
0
        public async Task Get_Claims_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.RoleStore roleStore = _context.GetRoleStore();

            // Act
            System.Collections.Generic.IList <System.Security.Claims.Claim> result = await roleStore.GetClaimsAsync(_context.GenerateRole(), new System.Threading.CancellationToken());

            roleStore.Dispose();
            // Assert
            Assert.NotEmpty(result);
        }
Esempio n. 2
0
        public async Task Find_By_Id_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.RoleStore roleStore = _context.GetRoleStore();

            // Act
            LetPortal.Identity.Entities.Role result = await roleStore.FindByIdAsync("5c06a15e4cc9a850bca44488", new System.Threading.CancellationToken());

            roleStore.Dispose();
            // Assert
            Assert.NotNull(result);
        }
Esempio n. 3
0
        public async Task Add_Claims_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.RoleStore roleStore = _context.GetRoleStore();

            // Act
            await roleStore.AddClaimAsync(_context.GenerateRole(), new System.Security.Claims.Claim("Aaa", "asdas"), new System.Threading.CancellationToken());

            roleStore.Dispose();
            // Assert
            Assert.True(true);
        }
Esempio n. 4
0
        public async Task Set_RoleName_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.RoleStore roleStore = _context.GetRoleStore();

            // Act
            await roleStore.SetRoleNameAsync(_context.GenerateRole(), "aaa", new System.Threading.CancellationToken());

            roleStore.Dispose();
            // Assert
            Assert.True(true);
        }
Esempio n. 5
0
        public async Task Remove_Claim_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.RoleStore roleStore = _context.GetRoleStore();

            // Act
            await roleStore.RemoveClaimAsync(_context.GenerateRole(), new System.Security.Claims.Claim("apps", "5c162e9005924c1c741bfd22"), new System.Threading.CancellationToken());

            roleStore.Dispose();
            // Assert
            Assert.True(true);
        }
Esempio n. 6
0
        public async Task Get_Role_Name_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.RoleStore roleStore = _context.GetRoleStore();

            // Act
            string result = await roleStore.GetRoleNameAsync(_context.GenerateRole(), new System.Threading.CancellationToken());

            roleStore.Dispose();
            // Assert
            Assert.True(!string.IsNullOrEmpty(result));
        }
Esempio n. 7
0
        public async Task Find_By_Name_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.RoleStore roleStore = _context.GetRoleStore();

            // Act
            LetPortal.Identity.Entities.Role result = await roleStore.FindByNameAsync("SUPERADMIN", new System.Threading.CancellationToken());

            roleStore.Dispose();

            // Assert
            Assert.NotNull(result);
        }
Esempio n. 8
0
        public async Task Delete_Role_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.RoleStore roleStore = _context.GetRoleStore();
            LetPortal.Identity.Entities.Role    role      = _context.GenerateRole();
            // Act
            await roleStore.CreateAsync(role, new System.Threading.CancellationToken());

            await roleStore.DeleteAsync(role, new System.Threading.CancellationToken());

            roleStore.Dispose();
            // Assert
            Assert.True(true);
        }