public void EnqueueAnnouncement_ShouldExecuteCallback_Test() { AutoResetEvent executed = new AutoResetEvent(false); NetworkException exception = null; var called = false; _nonInterceptedPeer.EnqueueAnnouncement(new BlockAnnouncement(), ex => { exception = ex; called = true; executed.Set(); }); executed.WaitOne(); exception.ShouldBeNull(); called.ShouldBeTrue(); }
public void EnqueueBlock_ShouldExecuteCallback_Test() { AutoResetEvent executed = new AutoResetEvent(false); NetworkException exception = null; bool called = false; _nonInterceptedPeer.EnqueueBlock(new BlockWithTransactions(), ex => { exception = ex; called = true; executed.Set(); }); executed.WaitOne(); exception.ShouldBeNull(); called.ShouldBeTrue(); }