anchor.diff:  open QueueTypes
   open QueueActors
   open NUnit.Framework
  +
  +let wait (milliseconds : int) = System.Threading.Thread.Sleep(milliseconds)
   
   type AccumulatorRequest = Query
   
  
positive.code:     let subscriber = spawn system subcriberName (queueReaderActor<string> id accumulator)
      (subscriber, accumulator)
  
  [<Test>]
  let ``Work queue``() = 
      let (system, queueFactory) = startSystem ()
      let queue = createDirectQueue queueFactory "hello" ""
  
      let (subscriber, accumulator) = createSubscriber system "subscriber"
  
      queue <! Connect
      queue <! Subscribe subscriber
      queue <! Publish (Content "Hi!")
      wait 1
      queue <! Disconnect
  
      let (messages : string list) = accumulator <? Query |> Async.RunSynchronously
      Assert.AreEqual(["Hi!"], messages)
      stopSystem system
  
  [<Test>]
  let ``Pub/sub``() = 
      let (system, queueFactory) = startSystem ()
      let exchange = createFanoutExchange queueFactory "logs"
      let queue1 = createDirectQueue queueFactory "logs1" "logs"
      let queue2 = createDirectQueue queueFactory "logs2" "logs"
  
      let (subscriber1, accumulator1) = createSubscriber system "subscriber1"
      let (subscriber2, accumulator2) = createSubscriber system "subscriber2"
  
      exchange <! Connect
      queue1 <! Connect
      queue2 <! Connect
      queue1 <! Subscribe subscriber1
      exchange <! Publish (Content "Hi 1!")
      queue2 <! Subscribe subscriber2
      exchange <! Publish (Content "Hi 2!")
      wait 1
      exchange <! Disconnect
      queue1 <! Disconnect
      queue2 <! Disconnect
  
      let (messages : string list) = accumulator1 <? Query |> Async.RunSynchronously
      Assert.AreEqual(["Hi 2!"; "Hi 1!"], messages)
      let (messages : string list) = accumulator2 <? Query |> Async.RunSynchronously
      Assert.AreEqual(["Hi 2!"; "Hi 1!"], messages)
      stopSystem system
  
negative.code:     }
      loop ([])
  
  let startSystem () =
      let system = System.create "system" <| Configuration.load ()
      let queueFactory = spawn system "queues" (queueFactoryActor {Hostname="localhost";Username="guest";Password="guest"})
  