public void Stock_NotifyAllWhenSetValue() { var stock = new Stock("Apple", 100); var ohioTechInvestor = new OhioTechInvestor(stock); var goldenSeedsInvestor = new GoldenSeedsInvestor(stock); stock.Value = 150; Assert.AreEqual(2, stock.Notified); }
static void Main(string[] args) { var stock = new Stock("IBM", 100); var ohioTechInvestor = new OhioTechInvestor(stock); var goldenSeedsInvestor = new GoldenSeedsInvestor(stock); stock.Value = 180; Console.ReadKey(); }