UpdateAbility() 공개 메소드

public UpdateAbility ( IAbility ability ) : IAbility
ability IAbility
리턴 IAbility
        public void TestUpdateAbility()
        {
            _authorizationService = new AbilityAuthorizationService(new UserRepository(), new RoleRepository(), new AbilityRepository());
            _authorizationService.AddAbility(_ability1);
            _authorizationService.AddAbility(_ability2);
            IEnumerable<IAbility> abilitys = _authorizationService.GetAbilities();
            Assert.AreEqual(2, abilitys.Count());
            Assert.AreEqual(_ability1, abilitys.First());
            Assert.AreEqual(_ability2, abilitys.Last());

            _ability2.Name = "AbilityUpdate";
            _authorizationService.UpdateAbility(_ability2);
            abilitys = _authorizationService.GetAbilities();
            Assert.AreEqual(2, abilitys.Count());
            Assert.AreEqual(_ability1, abilitys.First());
            Assert.AreEqual(_ability2, abilitys.Last());
            Assert.AreEqual("AbilityUpdate", abilitys.Last().Name);
        }