Ejemplo n.º 1
0
 public void announce_should_return_after_all_recipients_have_been_notified_but_before_they_finish()
 {
     var test_subject = new MailRoom();
     test_subject.subscribe<SillyMessage>(message_handler_that_never_finishes);
     test_subject.announce(new SillyMessage("hi"));
     _log.Should()
         .ContainInOrder(new object[] {"Notified: hi"});
 }
Ejemplo n.º 2
0
 public void universal_subscribers_should_receive_all_messages()
 {
     var test_subject = new MailRoom();
     var log = store_all_values();
     test_subject.subscribe_to_all(log.accept);
     test_subject.announce(new SillyMessage("silly"));
     test_subject.announce_and_wait(new SeriousMessage("serious"), TimeSpan.Zero);
     log.received.Should()
         .ContainInOrder(new object[] {"silly", "serious"});
 }