Esempio n. 1
0
        public void ordered_the_way_we_expect_it_to_be()
        {
            AsyncWatcher.Clear();

            using (var runtime = FubuTransport.For <AsyncRegistry>().StructureMap().Bootstrap())
            {
                var invoker = runtime.Factory.Get <IChainInvoker>();
                var message = new Foo {
                    Name = "Buck Rogers"
                };

                invoker.InvokeNow(message);

                Wait.Until(() => AsyncWatcher.Messages.Count() == 4);

                AsyncWatcher.Messages.ElementAt(0).ShouldEqual("wrapper:start");
                AsyncWatcher.Messages.ElementAt(1).ShouldEndWith("Buck Rogers");
                AsyncWatcher.Messages.ElementAt(2).ShouldEndWith("Buck Rogers");
                AsyncWatcher.Messages.ElementAt(3).ShouldEndWith("wrapper:finish");
            }
        }
Esempio n. 2
0
 protected override void invoke(Action action)
 {
     AsyncWatcher.Write("wrapper:start");
     action();
     AsyncWatcher.Write("wrapper:finish");
 }