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); }