Example #1
0
        public void TestMultipleSinks()
        {
            var sink2 = new MockTimeSink(source);

            source.RegisterObserver(sink2);

            source.SetTime(12, 13, 14);
            AssertSinkEquals(sink, 12, 13, 14);
            AssertSinkEquals(sink2, 12, 13, 14);
        }
Example #2
0
 public void SetUp()
 {
     source = new MockTimeSource();
     sink   = new MockTimeSink(source);
     source.RegisterObserver(sink);
 }
Example #3
0
 private static void AssertSinkEquals(MockTimeSink sink, int hours, int mins, int secs)
 {
     Assert.AreEqual(hours, sink.Hours);
     Assert.AreEqual(mins, sink.Minutes);
     Assert.AreEqual(secs, sink.Seconds);
 }