anchor.diff:  
   let wait numberOfSeconds = System.Threading.Thread.Sleep(numberOfSeconds * 1000)
   
  +let startSystem () =
  +    let system = System.create "system" <| Configuration.load ()
  +    let queueFactory = spawn system "queues" (queueFactoryActor {Hostname="localhost";Username="guest";Password="guest"})
  +    (system, queueFactory)
  +
  +let stopSystem (system : ActorSystem) =
  +    system.Terminate() |> Async.AwaitTask |> Async.RunSynchronously
  +
  +let createDirectQueue queueFactory queueName exchangeName =
  +    let queueParams = { QueueName = queueName; ExchangeName = exchangeName; ExchangeType = Direct; Durable = false; Arguments = null }
  +    let (queue : IActorRef) = queueFactory <? CreateExchange (sprintf "direct_%s" queueName, queueParams, false) |> Async.RunSynchronously
  +    queue
  +
  +let createFanoutExchange queueFactory exchangeName =
  +    let exchangeParams = { QueueName = ""; ExchangeName = exchangeName; ExchangeType = Fanout; Durable = false; Arguments = null }
  +    let (exchange : IActorRef) = queueFactory <? CreateExchange (sprintf "fanout_%s" exchangeName, exchangeParams, true) |> Async.RunSynchronously
  +    exchange
  +
  +let createSubscriber system subcriberName =
  +    let accumulator = spawn system (sprintf "accumulator_%s" subcriberName) accumulatorActor
  +    let subscriber = spawn system subcriberName (queueReaderActor<string> id accumulator)
  +    (subscriber, accumulator)
  +
   [<Test>]
   let ``Work queue``() = 
  -    let system = System.create "system" <| Configuration.load ()
  -    let queuefactory = spawn system "queues" (queueFactoryActor {Hostname="localhost";Username="guest";Password="guest"})
  -    let accumulator = spawn system "accumulator" accumulatorActor
  -    let subscriber = spawn system "subscriber" (queueReaderActor<string> id accumulator)
  -    let queueParams = { QueueName = "hello"; ExchangeName = ""; ExchangeType = Direct; Durable = false; Arguments = null }
  -    let (queue : IActorRef) = queuefactory <? CreateExchange ("work", queueParams, false) |> Async.RunSynchronously
  +    let (system, queueFactory) = startSystem ()
  +    let queue = createDirectQueue queueFactory "hello" ""
  +
  +    let (subscriber, accumulator) = createSubscriber system "subscriber"
   
       queue <! Connect
       queue <! Subscribe subscriber
  
positive.code:     Assert.AreEqual(["Hi 2!"; "Hi 1!"], messages)
      let (messages : string list) = accumulator2 <? Query |> Async.RunSynchronously
      Assert.AreEqual(["Hi 2!"; "Hi 1!"], messages)
      system.Terminate() |> Async.AwaitTask |> Async.RunSynchronously
  
negative.code: 
      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
  