public void TestChangeName() { Person p = new Person(); PersonObserver ob = new PersonObserver(); p.PropertyChanged += ob.PropertyChanged; p.Name = "H"; Assert.AreEqual("Name", ob.ChangedName); }
public void TestChangeAge() { Person p = new Person(); PersonObserver ob = new PersonObserver(); p.PropertyChanged += ob.PropertyChanged; p.Age = 0; Assert.AreEqual(null, ob.ChangedName); p.Age = 3; Assert.AreEqual("Age", ob.ChangedName); }