GetAbilitiesForUser() 공개 메소드

public GetAbilitiesForUser ( IUser user ) : IEnumerable
user IUser
리턴 IEnumerable
        public void TestGetAbilitiesForUser()
        {
            _authorizationService = new AbilityAuthorizationService(new UserRepository(), new RoleRepository(), new AbilityRepository());
            _role1.Abilities.Add(_ability1);
            _role2.Abilities.Add(_ability2);
            _user1.Roles.Add(_role1);
            _user1.Roles.Add(_role2);
            _authorizationService.AddUser(_user1);

            IEnumerable<IAbility> abilities = _authorizationService.GetAbilitiesForUser(_user1.Name);
            Assert.AreEqual(2, abilities.Count());
            Assert.AreEqual(_ability1, abilities.First());
            Assert.AreEqual(_ability2, abilities.Last());
        }