コード例 #1
0
        public void FindById_FindsTheOnlyTwoRoles(ERoleName roleId)
        {
            // Arrange
            var roleStore = new RoleStore <Role>();

            // Act
            var result = roleStore.FindByIdAsync(roleId.ToString(), CancellationToken.None);

            // Assert
            Assert.That(result.Result.Name, Is.EqualTo(roleId));
        }
コード例 #2
0
        public void GetRoleName_ReturnsRoleName(ERoleName roleName)
        {
            // Arrange
            var roleStore = new RoleStore <Role>();
            var role      = new Role {
                Name = roleName
            };

            // Act
            var result =
                roleStore.GetRoleNameAsync(role, CancellationToken.None);

            // Assert
            Assert.That(result.Result, Is.EqualTo(roleName.ToString()));
        }