public void invoking_a_chain_will_execute_completely_with_cascading_immediate_continuations() { FubuTransport.SetupForInMemoryTesting(); using (var runtime = FubuApplication.BootstrapApplication <ChainInvokerApplication>()) { var recorder = runtime.Factory.Get <MessageRecorder>(); var invoker = runtime.Factory.Get <IChainInvoker>(); MessageHistory.WaitForWorkToFinish(() => { invoker.InvokeNow(new TriggerImmediate { Text = "First", ContinueText = "I'm good" }); }); recorder.Messages.Each(x => Debug.WriteLine(x)); // Should process all the cascading messages that bubble up // and their cascaded messages recorder.Messages.ShouldContain("First"); recorder.Messages.ShouldContain("I'm good"); recorder.Messages.ShouldContain("I'm good-2"); recorder.Messages.ShouldContain("I'm good-2-4"); recorder.Messages.ShouldContain("I'm good-2-3"); recorder.Messages.ShouldContain("Traced: I'm good"); } }
public void invoking_a_chain_will_execute_with_failure_does_not_send_off_cascading_messages() { FubuTransport.SetupForInMemoryTesting(); using (var runtime = FubuApplication.BootstrapApplication <ChainInvokerApplication>()) { var recorder = runtime.Factory.Get <MessageRecorder>(); var invoker = runtime.Factory.Get <IChainInvoker>(); MessageHistory.WaitForWorkToFinish(() => { // The handler for WebMessage is rigged to throw exceptions // if it contains the text 'Bad' invoker.InvokeNow(new WebMessage { Text = "Bad message" }); }); recorder.Messages.Each(x => Debug.WriteLine(x)); // NO MESSAGES SHOULD GET OUT WITH THE ORIGINAL 'Bad Message' recorder.Messages.Any(x => x.Contains("Bad message")).ShouldBeFalse(); AssertCascadedMessages(recorder); } }
protected void Application_Start(object sender, EventArgs e) { // Simplest possible way to bootstrap w/ StructureMap // You can do this if you want: // FubuApplication.DefaultPolicies().StructureMap(new Container()).Bootstrap(); _runtime = FubuApplication.BootstrapApplication <MyApplication>(); }
protected void Application_Start(object sender, EventArgs e) { _runtime = FubuApplication.BootstrapApplication <AspNetApplication>(); }
public static void Start() { FubuApplication.BootstrapApplication <MyApplication>(); }
protected void Application_Start(object sender, EventArgs e) { FubuApplication.BootstrapApplication <MyApplication>(); }
protected void Application_Start(object sender, EventArgs e) { // Start the runtime at application start _runtime = FubuApplication .BootstrapApplication <SimpleApplicationSource>(); }