Skip to content

Instantly share code, notes, and snippets.

@jmarnold
Created April 21, 2015 14:14
Show Gist options
  • Save jmarnold/9462a4804b984514ca94 to your computer and use it in GitHub Desktop.
Save jmarnold/9462a4804b984514ca94 to your computer and use it in GitHub Desktop.
Can't find the behavior
[TestFixture]
public class what_the_heck
{
[Test]
public void debug()
{
AppStartFubuMVC.Start();
var route = RouteTable
.Routes
.OfType<Route>()
.Single(x => x.Url == "");
var invoker = route.RouteHandler.As<FubuRouteHandler>().Invoker.As<BehaviorInvoker>();
var chain = (BehaviorChain) typeof (BehaviorInvoker)
.GetField("_chain", BindingFlags.Instance | BindingFlags.NonPublic)
.GetValue(invoker);
var instanceRef = ObjectFactory.Container.Model.AllInstances.Single(x => x.Name == chain.UniqueId.ToString());
Debug.WriteLine(instanceRef);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment