Example #1
0
        public void configure_not_implemented()
        {
            IConfigurationAction configActionVisitor = new RouteVisitor();

            typeof(NotImplementedException).ShouldBeThrownBy(
                () => configActionVisitor.Configure(BehaviorGraph.BuildEmptyGraph()));
        }
        public void IAssetTagBuilder_is_registered_in_development_mode()
        {
            FubuMode.SetUpForDevelopmentMode();

            BehaviorGraph.BuildEmptyGraph().Services.DefaultServiceFor <IAssetTagBuilder>().Type.ShouldEqual(
                typeof(DevelopmentModeAssetTagBuilder));
        }
Example #3
0
        public void no_about_endpoint_if_not_in_development_mode()
        {
            var graph = BehaviorGraph.BuildEmptyGraph();

            graph.ChainFor <AboutFubuDiagnostics>(x => x.get_about())
            .ShouldBeNull();
        }
        public void should_register_the_files_service_from_the_behavior_graph_into_the_container()
        {
            var graph = BehaviorGraph.BuildEmptyGraph();

            graph.Services.DefaultServiceFor <IFubuApplicationFiles>().Value
            .ShouldBeTheSameAs(graph.Files);
        }
Example #5
0
        public void headers_cache_is_registered_as_a_singleton()
        {
            BehaviorGraph.BuildEmptyGraph().Services.DefaultServiceFor <IHeadersCache>().Value.ShouldBeOfType
            <HeadersCache>().ShouldNotBeNull();

            ServiceRegistry.ShouldBeSingleton(typeof(HeadersCache)).ShouldBeTrue();
        }
Example #6
0
        public void asset_file_watcher_should_be_registered_as_a_singleton()
        {
            BehaviorGraph.BuildEmptyGraph()
            .Services
            .DefaultServiceFor <IAssetFileWatcher>()
            .Type.ShouldEqual(typeof(AssetFileWatcher));

            ServiceRegistry.ShouldBeSingleton(typeof(AssetFileWatcher)).ShouldBeTrue();
        }
        public void no_about_endpoint_if_not_in_development_mode()
        {
            FubuMode.Reset();

            var graph = BehaviorGraph.BuildEmptyGraph();

            graph.BehaviorFor <AboutEndpoint>(x => x.get__about())
            .ShouldBeNull();
        }
        public void adds_the_about_endpoint_if_in_development_mode()
        {
            FubuMode.Mode(FubuMode.Development);

            var graph = BehaviorGraph.BuildEmptyGraph();

            graph.BehaviorFor <AboutEndpoint>(x => x.get__about())
            .ShouldNotBeNull();
        }
        public void with_no_other_explicit_action_discovery()
        {
            var graph = BehaviorGraph.BuildEmptyGraph();


            graph.BehaviorFor <MyEndpoint>(x => x.Go()).ShouldNotBeNull();
            graph.BehaviorFor <MyEndpoints>(x => x.Go()).ShouldNotBeNull();
            graph.BehaviorFor <MyEndpoints>(x => x.Go2()).ShouldNotBeNull();
        }
        public void asset_pipeline_is_registered_as_both_IAssetPipeline_and_IAssetFileRegistration_as_the_same_instance()
        {
            var services  = BehaviorGraph.BuildEmptyGraph().Services;
            var pipeline1 = services.DefaultServiceFor <IAssetPipeline>().Value.ShouldBeOfType <AssetPipeline>();
            var pipeline2 = services.DefaultServiceFor <IAssetFileRegistration>().Value.ShouldBeOfType <AssetPipeline>();

            pipeline1.ShouldNotBeNull();
            pipeline2.ShouldNotBeNull();

            pipeline1.ShouldBeTheSameAs(pipeline2);
        }
        public void asset_graph_and_pipeline_activators_are_registered_in_the_correct_order()
        {
            var activators = BehaviorGraph.BuildEmptyGraph().Services.ServicesFor <IActivator>().ToList();

            activators.Any(x => x.Type == typeof(AssetGraphConfigurationActivator)).ShouldBeTrue();
            activators.Any(x => x.Type == typeof(AssetPipelineBuilderActivator)).ShouldBeTrue();
            activators.Any(x => x.Type == typeof(AssetDeclarationVerificationActivator)).ShouldBeTrue();
            activators.Any(x => x.Type == typeof(AssetPolicyActivator)).ShouldBeTrue();

            activators.RemoveAll(x => !x.Type.Namespace.Contains(typeof(AssetGraph).Namespace));

            activators[0].Type.ShouldEqual(typeof(AssetPrecompilerActivator));
            activators[1].Type.ShouldEqual(typeof(AssetGraphConfigurationActivator));
            activators[2].Type.ShouldEqual(typeof(AssetPipelineBuilderActivator));
            activators[3].Type.ShouldEqual(typeof(AssetDeclarationVerificationActivator));
            activators[4].Type.ShouldEqual(typeof(MimetypeRegistrationActivator));
            activators[5].Type.ShouldEqual(typeof(AssetCombinationBuildingActivator));
            activators[6].Type.ShouldEqual(typeof(AssetPolicyActivator));
            activators[7].Type.ShouldEqual(typeof(AssetFileWatchingActivator));
        }
 public void a_value_of_stringifier_is_registered()
 {
     BehaviorGraph.BuildEmptyGraph().Services.DefaultServiceFor(typeof(Stringifier)).Value.ShouldBeOfType
     <Stringifier>();
 }
 public void script_graph_is_registered()
 {
     BehaviorGraph.BuildEmptyGraph().Services.DefaultServiceFor <AssetGraph>().Value.ShouldNotBeNull();
 }
 public void log_record_modifier_is_registered()
 {
     BehaviorGraph.BuildEmptyGraph().Services.ServicesFor <ILogModifier>()
     .Any(x => x.Type == typeof(LogRecordModifier)).ShouldBeTrue();
 }
        private static BehaviorGraph buildGraph()
        {
            BehaviorGraph graph = BehaviorGraph.BuildEmptyGraph();

            return(graph);
        }
 public void should_be_a_script_configuration_activator_registered_as_a_service()
 {
     BehaviorGraph.BuildEmptyGraph().Services.ServicesFor <IActivator>()
     .Any(x => x.Type == typeof(AssetGraphConfigurationActivator)).ShouldBeTrue();
 }
 public CoreServiceRegistry_specification()
 {
     FubuMode.Reset();
     _serviceGraph = BehaviorGraph.BuildEmptyGraph().Services;
 }
 public void registers_the_display_conversion_registry_activator()
 {
     BehaviorGraph.BuildEmptyGraph().Services.ServicesFor(typeof(IActivator))
     .Any(x => x.Type == typeof(DisplayConversionRegistryActivator));
 }
Example #19
0
 private void registeredTypeIs <TService, TImplementation>()
 {
     BehaviorGraph.BuildEmptyGraph().Services.DefaultServiceFor <TService>().Type.ShouldEqual(
         typeof(TImplementation));
 }
Example #20
0
 public void Logger_should_be_registered_as_a_core_service()
 {
     BehaviorGraph.BuildEmptyGraph().Services.DefaultServiceFor <ILogger>()
     .Type.ShouldEqual(typeof(Logger));
 }
        public void SetUp()
        {
            var behaviorGraph = BehaviorGraph.BuildEmptyGraph();

            theChain = behaviorGraph.BehaviorFor <AssetWriter>(x => x.Write(null));
        }
Example #22
0
 public void resource_binder_is_registered_by_default()
 {
     BehaviorGraph.BuildEmptyGraph().Services
     .ServicesFor <IModelBinder>()
     .Any(x => x.Type == typeof(ResourcePathBinder)).ShouldBeTrue();
 }
Example #23
0
 public void SetUp()
 {
     FubuMode.SetUpForDevelopmentMode();
     graph = BehaviorGraph.BuildEmptyGraph();
 }
Example #24
0
 public void clock_is_registered_as_a_singleton()
 {
     registeredTypeIs <IClock, Clock>();
     BehaviorGraph.BuildEmptyGraph().Services.DefaultServiceFor <IClock>().IsSingleton
     .ShouldBeTrue();
 }
Example #25
0
 public void SetUp()
 {
     theServices = BehaviorGraph.BuildEmptyGraph().Services;
 }
        public void should_be_a_value_for_app_reloaded()
        {
            var services = BehaviorGraph.BuildEmptyGraph().Services;

            services.DefaultServiceFor <AppReloaded>().Value.ShouldBeOfType <AppReloaded>();
        }
Example #27
0
 public void should_use_the_trace_only_missing_handler_option_if_nothing_else_is_configured()
 {
     BehaviorGraph.BuildEmptyGraph().Services.DefaultServiceFor <IMissingAssetHandler>()
     .Type.ShouldEqual(typeof(TraceOnlyMissingAssetHandler));
 }
 public void an_activator_for_HtmlConventionActivator_is_registered()
 {
     BehaviorGraph.BuildEmptyGraph().Services.ServicesFor <IActivator>()
     .Any(x => x.Type == typeof(HtmlConventionsActivator)).ShouldBeTrue();
 }