예제 #1
0
        public void TestChangeName()
        {
            Person p = new Person();
            PersonObserver ob = new PersonObserver();
            p.PropertyChanged += ob.PropertyChanged;

            p.Name = "H";
            Assert.AreEqual("Name", ob.ChangedName);
        }
예제 #2
0
        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);
        }