public void TestYearObserver() { PersonRegister pr = new PersonRegister(); IObserverPush o = new YearObserver(pr); pr.p.GrowUp(); List <IObserverPush> observers = new List <IObserverPush>(); pr.Notify(); int expectedresult = 1; Assert.AreEqual(expectedresult, o.ToForm()); }
public void TestYearObserver() { List <IObserverPull> observers = new List <IObserverPull>(); PersonRegister pr = new PersonRegister(); IObserverPull yearob = new YearObserver(pr); pr.p.GrowUp(); pr.p.GrowUp(); int expectedresult = 2; pr.Notify(); Assert.AreEqual(expectedresult, yearob.ToForm()); }