Пример #1
0
        public void TestMultipleSinks()
        {
            MockTimeSink sink2 = new MockTimeSink();

            source.RegisterObserver(sink2);

            source.SetTime(12, 13, 14);
            AssertSinkEquals(sink, 12, 13, 14);
            AssertSinkEquals(sink2, 12, 13, 14);
        }
Пример #2
0
 private void AssertSinkEquals(MockTimeSink sink, int hours, int minutes, int seconds)
 {
     Assert.Equal(hours, sink.GetHours());
     Assert.Equal(minutes, sink.GetMinutes());
     Assert.Equal(seconds, sink.GetSeconds());
 }
Пример #3
0
 public ClockDriverTest()
 {
     source = new MockTimeSource();
     sink   = new MockTimeSink();
     source.RegisterObserver(sink);
 }