public void Configure(FubuRegistry registry) { registry.Policies.Local.Add <SpecialPolicy>(); registry.Import <SubModule>(); Applied++; }
public void is_registered() { var registry = new FubuRegistry(); registry.Import<ViewEnginesExtension>(); registry.AlterSettings<CommonViewNamespaces>(x => { x.Add("Foo"); x.Add("Bar"); }); var graph = BehaviorGraph.BuildFrom(registry); var useNamespaces = graph.Services.DefaultServiceFor<CommonViewNamespaces>().Value.As<CommonViewNamespaces>(); useNamespaces.Namespaces.Each(x => Debug.WriteLine(x)); useNamespaces.Namespaces.ShouldHaveTheSameElementsAs(new[] { typeof(VirtualPathUtility).Namespace, typeof(string).Namespace, typeof(FileSet).Namespace, typeof(ParallelQuery).Namespace, typeof(HtmlTag).Namespace, "Foo", "Bar", }); }
public void default_namespaces_are_set_including_anything_from_CommonViewNamespaces() { var registry = new FubuRegistry(); registry.Import <RazorViewFacility>(); registry.AlterSettings <CommonViewNamespaces>(x => { x.Add("Foo"); x.Add("Bar"); }); var graph = BehaviorGraph.BuildFrom(registry); var useNamespaces = graph.Services.DefaultServiceFor <CommonViewNamespaces>().Value.As <CommonViewNamespaces>(); useNamespaces.Namespaces.ShouldHaveTheSameElementsAs(new[] { "System.Web", "System", "FubuCore", "System.Linq", "HtmlTags", "FubuMVC.Core.UI", "FubuMVC.Core.UI.Extensions", "FubuMVC.Razor", "Foo", "Bar" }); }
protected override void configure(FubuRegistry registry) { registry.Actions.IncludeType<ShowEditEndpoints>(); registry.Import<HtmlConventionRegistry>(x => { x.FieldChrome<TableRowFieldChrome>(); }); }
public void SetUp() { var registry = new FubuRegistry(); registry.Import <YuiCompressionExtensions>(); theServices = BehaviorGraph.BuildFrom(registry).Services; }
public void SetUp() { var registry = new FubuRegistry(); registry.Import <BasicLocalizationSupport>(); graphWithBasicLocalizationAsIs = BehaviorGraph.BuildFrom(registry); }
public FubuApplication BuildApplication() { var registry = new FubuRegistry(); registry.Import <LightningQueuesDiagnosticsTransportRegistry>(); return(FubuApplication.For(registry).StructureMap()); }
public void SetUp() { var registry = new FubuRegistry(); registry.Import <ApplyWindowsAuthentication>(); theGraph = BehaviorGraph.BuildFrom(registry); }
protected override void configure(FubuRegistry registry) { registry.Services(x => x.AddService<IFieldAccessRule, ShowEditFakePolicy>()); registry.Actions.IncludeType<ShowEditEndpoints>(); registry.Import<HtmlConventionRegistry>(x => { x.Profile("table", profile => profile.FieldChrome<TableRowFieldChrome>()); }); }
public void SetUp() { var registry = new FubuRegistry(); registry.Import <BasicLocalizationSupport>(); graphWithBasicLocalizationAsIs = registry.BuildGraph(); }
public void Configure(FubuRegistry registry) { // registry // .Import<SassExtension>(); registry .Import <VisualizationFubuRegistry>(DiagnosticsRegistration.DIAGNOSTICS_URL_ROOT); }
public void SetUp() { var registry = new FubuRegistry(); registry.Actions.IncludeType <NothingEndpoint>(); // Have to do this to make it an isolated test registry.Import <ApplyAuthentication>(); theGraphWithBasicAuthentication = BehaviorGraph.BuildFrom(registry); }
private void registeredTypeIs <TService, TImplementation>() { var fubuRegistry = new FubuRegistry(); fubuRegistry.Import <WebFormsEngine>(); fubuRegistry.BuildGraph().Services.DefaultServiceFor <TService>().Type.ShouldEqual( typeof(TImplementation)); }
public void register_a_non_default_culture_info() { var registry = new FubuRegistry(); registry.Import <BasicLocalizationSupport>(x => x.DefaultCulture = new CultureInfo("en-CA")); BehaviorGraph.BuildFrom(registry).Services.DefaultServiceFor(typeof(CultureInfo)) .Value.ShouldEqual(new CultureInfo("en-CA")); }
public void SetUp() { var registry = new FubuRegistry(); registry.Import <WebFormsEngine>(); registry.Views.RegisterActionLessViews(token => token.ViewType.Name.StartsWith("FakeView"), (chain, token) => chain.Route = new RouteDefinition(token.Name)); theBehaviorGraph = registry.BuildGraph(); }
protected override void configure(FubuRegistry registry) { registry.Import <SparkEngine>(); registry.Actions.IncludeType <UsesPartialController>(); registry.Actions.IncludeType <HelloPartialController>(); registry.Actions.IncludeType <TransferToController>(); registry.Actions.IncludeType <RedirectToController>(); registry.Actions.IncludeType <UsesNativeController>(); registry.Views.TryToAttachWithDefaultConventions(); }
public void SetUp() { var registry = new FubuRegistry(); registry.Import <WebFormsEngine>(); registry.Views.RegisterActionLessViews(token => token.ViewType.Name.StartsWith("FakeView"), chain => chain.IsPartialOnly = true); theBehaviorGraph = registry.BuildGraph(); }
public void SetUp() { var registry = new FubuRegistry(); registry.Import <WebFormsEngine>(); registry.Views.RegisterActionLessViews(WebFormViewFacility.IsWebFormControl, chain => chain.IsPartialOnly = true); theBehaviorGraph = registry.BuildGraph(); }
public void SetUp() { var registry = new FubuRegistry(); registry.Import <DiagnosticsRegistration>(); graph = BehaviorGraph.BuildFrom(registry); urls = MockRepository.GenerateMock <IUrlRegistry>(); graph.Behaviors.Any().ShouldBeTrue(); }
public void ensure_namespaces_are_imported() { var registry = new FubuRegistry(); registry.Import <ContentExtensionsRegistration>(); var graph = BehaviorGraph.BuildFrom(registry); var commonViewNamespaces = graph.Services.DefaultServiceFor <CommonViewNamespaces>().Value.As <CommonViewNamespaces>(); commonViewNamespaces.Namespaces.ShouldContain(typeof(ContentExtensionGraph).Namespace); }
public void import_with_strings_instead_of_StringToken() { var registry = new FubuRegistry(); registry.Import <NavigationRegistryExtension>(); registry.Policies.Add <NavigationRegistry>(x => { x.ForMenu("Key1"); x.Add += MenuNode.Node("Key2"); x.Add += MenuNode.Node("Key3"); }); registry.Import <ChildRegistry>(); var graph = BehaviorGraph.BuildFrom(registry).Settings.Get <NavigationGraph>(); graph.MenuFor("Key1").Select(x => x.Key) .ShouldHaveTheSameElementsAs(new NavigationKey("Key2"), new NavigationKey("Key3")); }
public void the_url_prefix_of_a_fubu_package_registry_should_be_respected() { var registry = new FubuRegistry(); registry.Import <FooPackageRegistry>(); var graph = BehaviorGraph.BuildFrom(registry); graph.BehaviorFor <FooEndpointClass>(x => x.get_some_foo()) .GetRoutePattern().ShouldEqual("moar/some/foo"); }
public void should_only_apply_behavior_once() { var hostRegistry = new FubuRegistry(); var packageRegistry = new FubuPackageRegistry(); packageRegistry.Actions.IncludeType <Controller1>(); hostRegistry.Import(packageRegistry, string.Empty); theGraph = BehaviorGraph.BuildFrom(hostRegistry); var chain = chainFor(x => x.BasicContinuation(null)) .Output.Writers.OfType <Writer>().ShouldHaveCount(1); }
public void SetUp() { var registry = new FubuRegistry(); registry.Import <DiagnosticsRegistration>(); graph = BehaviorGraph.BuildFrom(registry); urls = MockRepository.GenerateMock <IUrlRegistry>(); graph.Behaviors.Any().ShouldBeTrue(); graph.Actions().Each(x => Debug.WriteLine(x.Description)); }
public void adds_chains_from_import_with_a_prefix() { import.Actions.IncludeType <Action1>(); parent.Import(import, "import"); var graph = BehaviorGraph.BuildFrom(parent); graph.BehaviorFor <Action1>(x => x.M1()).As <RoutedChain>().GetRoutePattern().ShouldEqual("import/a/m1"); graph.BehaviorFor <Action1>(x => x.M2()).As <RoutedChain>().GetRoutePattern().ShouldEqual("import/a/m2"); }
private void registeredTypeIs <TService, TImplementation>() { var registry = new FubuRegistry(); registry.Import <NavigationRegistryExtension>(); using (var runtime = registry.ToRuntime()) { var container = runtime.Get <IContainer>(); container.Model.For <TService>().Default.ReturnedType.ShouldBe(typeof(TImplementation)); } }
public void adds_chains_from_import_with_a_prefix() { import.Route("a/m1").Calls <Action1>(x => x.M1()); import.Route("a/m2").Calls <Action1>(x => x.M2()); parent.Import(import, "import"); var graph = BehaviorGraph.BuildFrom(parent); graph.BehaviorFor <Action1>(x => x.M1()).GetRoutePattern().ShouldEqual("import/a/m1"); graph.BehaviorFor <Action1>(x => x.M2()).GetRoutePattern().ShouldEqual("import/a/m2"); }
public FubuApplication BuildApplication() { var registry = new FubuRegistry(); registry.Import <DiagnosticApplication>(); registry.AlterSettings <TransportSettings>(x => { x.DelayMessagePolling = Int32.MaxValue; x.ListenerCleanupPolling = Int32.MaxValue; }); return(FubuApplication.For(registry).StructureMap()); }
public void uses_the_specified_OAuthSettings() { var theSettings = new OAuthSettings { ConsumerKey = "blah", ConsumerSecret = "private" }; var registry = new FubuRegistry(); registry.Import <ApplyTwitterAuthentication>(x => x.UseOAuthSettings(theSettings)); var graph = BehaviorGraph.BuildFrom(registry); graph.Services.DefaultServiceFor <OAuthSettings>().Value.ShouldEqual(theSettings); }
public void should_only_apply_behavior_once() { var hostRegistry = new FubuRegistry(); var packageRegistry = new FubuPackageRegistry(); packageRegistry.Actions.IncludeType <Controller1>(); hostRegistry.Import(packageRegistry, string.Empty); theGraph = hostRegistry.BuildGraph(); chainFor(x => x.BasicContinuation(null)) .Where(x => x is AjaxContinuationNode) .ShouldHaveCount(1); }
public void import_navigation_from_child_registry() { var registry = new FubuRegistry(); registry.Import <NavigationRegistryExtension>(); registry.Policies.Add <NavigationRegistry>(x => { x.ForMenu(FakeKeys.Key1); x.Add += MenuNode.Node(FakeKeys.Key2); x.Add += MenuNode.Node(FakeKeys.Key3); }); registry.Import <ChildRegistry>(); var graph = BehaviorGraph.BuildFrom(registry).Settings.Get <NavigationGraph>(); graph.MenuFor(FakeKeys.Key1).Select(x => x.Key) .ShouldHaveTheSameElementsAs(FakeKeys.Key2, FakeKeys.Key3, FakeKeys.Key4, FakeKeys.Key5); graph.MenuFor(FakeKeys.Key6).Select(x => x.Key) .ShouldHaveTheSameElementsAs(FakeKeys.Key7, FakeKeys.Key8); }
protected override void configure(FubuRegistry registry) { registry.Actions.IncludeType <CreateUserEndpoint>(); registry.Import <FubuMvcValidation>(); theUserService = new UserService(); registry.Services(r => r.SetServiceIfNone <IUserService>(theUserService)); var rule = RemoteFieldRule.For(ReflectionHelper.GetAccessor <CreateUser>(x => x.Username), new UniqueUsernameRule()); theField = new ValidateField { Hash = rule.ToHash(), Value = "joel_arnold" }; theUserService.AddUser(theField.Value); }
private void configurationIs(Action <DateTimePolicies> action) { container = new Container(); var registry = new FubuRegistry(); registry.Services(x => { x.SetServiceIfNone <ITimeZoneContext>(theTimeZoneContext); }); registry.Import <DateTimePolicies>(action); FubuApplication.For(registry).StructureMap(container).Bootstrap(); _formatter = container.GetInstance <IDisplayFormatter>(); }
void IFubuRegistryExtension.Configure(FubuRegistry registry) { registry.Import(this, _urlPrefix); }
void IFubuRegistryExtension.Configure(FubuRegistry registry) { registry.Import(this, UrlPrefix); registry.Config.ImportGlobals(Config); }