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", }); }
public void Dispose() { manager.RegisterEvent(string.Format("{0}: disposed", instanceNumber)); }