Exemplo n.º 1
0
 public void Test_Stop()
 {
     using (var countDown = new CountdownEvent(2))
     {
         using (var publisher = new MockBufferedPublisher(() => { countDown.Signal(); }))
         {
             publisher.Start();
             publisher.Stop(100);
             publisher.Start();
             Assert.IsTrue(countDown.Wait(500));
         }
     }
 }
Exemplo n.º 2
0
 public void Test_ConsumerAction_And_Start()
 {
     using (var countDown = new CountdownEvent(1))
     {
         using (var publisher = new MockBufferedPublisher(() => { countDown.Signal(); }))
         {
             publisher.Start();
             Assert.IsTrue(countDown.Wait(100));
         }
     }
 }