Exemplo n.º 1
0
        public void CanProperlyCommitUnitOfWork()
        {
            // arrange
            handlerActivatorForTesting.Handle <string>(str => unitOfWorkManager.RegisterEvent("Handled message: " + str));

            // act
            receiveMessages.Deliver(MessageWith("hello there!"));
            worker.Start();
            Thread.Sleep(500);
            worker.Stop();

            // assert
            unitOfWorkManager.Events
            .ShouldBe(new[]
            {
                "Unit of work created: 1",
                "Handled message: hello there!",
                "1: committed",
                "1: disposed",
            });
        }
Exemplo n.º 2
0
 public void Dispose()
 {
     manager.RegisterEvent(string.Format("{0}: disposed", instanceNumber));
 }