public void Test_When_Calls_Provided_Callback()
        {
            Func <IRouteBuilder, IRouteBuilder> routeBuilder =
                Substitute.For <Func <IRouteBuilder, IRouteBuilder> >();

            builder.When(routeBuilder);
            routeBuilder.Received(1)(Arg.Any <IRouteBuilder>());
        }
 public static IRouterBuilder When <TViewModel>(this IRouterBuilder builder) =>
 builder.When(route => route.SetViewModel(typeof(TViewModel)));
 public static IRouterBuilder When <TViewModel>(this IRouterBuilder builder,
                                                Func <IRouteBuilder, IRouteBuilder> buildRoute) =>
 builder.When(route => buildRoute(route.SetViewModel(typeof(TViewModel))));