public void transient_cache_by_default_is_a_nullo() { var plugins = new PluginGraph(); var pipeline = new RootPipelineGraph(plugins); pipeline.Transients.ShouldBeOfType<NulloTransientCache>(); }
public void transient_cache_of_nested_pipeline_graph_is_a_stateful_cache() { var plugins = new PluginGraph(); var pipeline = new RootPipelineGraph(plugins); pipeline.ToNestedGraph().Transients.ShouldBeOfType<LifecycleObjectCache>(); }
public void transient_cache_of_nested_pipeline_graph_is_a_stateful_cache() { var plugins = new PluginGraph(); var pipeline = new RootPipelineGraph(plugins); pipeline.ToNestedGraph().Transients.ShouldBeOfType <LifecycleObjectCache>(); }
public void singleton_is_just_the_plugin_graph_singletons() { var plugins = new PluginGraph(); plugins.SingletonCache.ShouldNotBeNull(); var pipeline = new RootPipelineGraph(plugins); pipeline.Singletons.ShouldBeTheSameAs(plugins.SingletonCache); }
public void transient_cache_by_default_is_a_nullo() { var plugins = new PluginGraph(); var pipeline = new RootPipelineGraph(plugins); pipeline.Transients.ShouldBeOfType <NulloTransientCache>(); }
public void When_calling_GetInstance_if_no_default_can_be_found_throw_202() { var graph = new RootPipelineGraph(new PluginGraph()); assertActionThrowsErrorCode(202, delegate { var session = new BuildSession(graph); session.GetInstance(typeof(IGateway)); }); }
public void Throw_200_When_trying_to_build_an_instance_that_cannot_be_found() { var graph = new RootPipelineGraph(new PluginGraph()); assertActionThrowsErrorCode(200, delegate { var session = new BuildSession(graph); session.CreateInstance(typeof(IGateway), "Gateway that is not configured"); }); }
public void singleton_is_just_the_plugin_graph_singletons() { var plugins = new PluginGraph(); plugins.SingletonCache.ShouldNotBeNull(); var pipeline = new RootPipelineGraph(plugins); pipeline.Singletons.ShouldBeTheSameAs(plugins.SingletonCache); }
public void SetUp() { lifecycle = new SingletonLifecycle(); disposable1 = new StubDisposable(); disposable2 = new StubDisposable(); pipeline = new RootPipelineGraph(new PluginGraph()); lifecycle.FindCache(pipeline).As <LifecycleObjectCache>().Set(typeof(IGateway), new StubInstance("a"), disposable1); lifecycle.FindCache(pipeline).As <LifecycleObjectCache>().Set(typeof(IGateway), new StubInstance("b"), disposable2); lifecycle.FindCache(pipeline).As <LifecycleObjectCache>().Set(typeof(IGateway), new StubInstance("c"), new object()); lifecycle.EjectAll(pipeline); }
private void writeConfigurationAndValidate(DoctorReport report, PluginGraph graph) { var pipelineGraph = new RootPipelineGraph(graph); var writer = new WhatDoIHaveWriter(pipelineGraph); report.WhatDoIHave = writer.GetText(); var session = ValidationBuildSession.ValidateForPluginGraph(graph); session.PerformValidations(); if (session.HasBuildErrors()) { report.Result = DoctorResult.BuildErrors; } else if (session.HasValidationErrors()) { report.Result = DoctorResult.ValidationErrors; } if (!session.Success) { report.ErrorMessages = session.BuildErrorMessages(); } }
public void When_calling_GetInstance_if_no_default_can_be_found_throw_202() { var graph = new RootPipelineGraph(new PluginGraph()); assertActionThrowsErrorCode(202, delegate { var session = new BuildSession(graph); session.GetInstance(typeof (IGateway)); }); }
public void Throw_200_When_trying_to_build_an_instance_that_cannot_be_found() { var graph = new RootPipelineGraph(new PluginGraph()); assertActionThrowsErrorCode(200, delegate { var session = new BuildSession(graph); session.CreateInstance(typeof (IGateway), "Gateway that is not configured"); }); }
public static ValidationBuildSession ValidateForPluginGraph(PluginGraph graph) { var pipeline = new RootPipelineGraph(graph); return(new ValidationBuildSession(pipeline)); }
public static ValidationBuildSession ValidateForPluginGraph(PluginGraph graph) { var pipeline = new RootPipelineGraph(graph); return new ValidationBuildSession(pipeline); }
public void SetUp() { lifecycle = new SingletonLifecycle(); disposable1 = new StubDisposable(); disposable2 = new StubDisposable(); pipeline = new RootPipelineGraph(new PluginGraph()); lifecycle.FindCache(pipeline).As<LifecycleObjectCache>().Set(typeof (IGateway), new StubInstance("a"), disposable1); lifecycle.FindCache(pipeline).As<LifecycleObjectCache>().Set(typeof(IGateway), new StubInstance("b"), disposable2); lifecycle.FindCache(pipeline).As<LifecycleObjectCache>().Set(typeof(IGateway), new StubInstance("c"), new object()); lifecycle.EjectAll(pipeline); }