public void all_explicitly_changed_settings_should_get_registered_as_a_service()
        {
            var registry = new FubuRegistry();

            var oneSettings = new OneSettings();
            registry.ReplaceSettings(oneSettings);
            var twoSettings = new TwoSettings();
            registry.ReplaceSettings(twoSettings);
            var threeSettings = new ThreeSettings();
            registry.ReplaceSettings(threeSettings);

            var graph = BehaviorGraph.BuildFrom(registry);

            graph.Services.DefaultServiceFor<OneSettings>().Value.ShouldBeTheSameAs(oneSettings);
            graph.Services.DefaultServiceFor<TwoSettings>().Value.ShouldBeTheSameAs(twoSettings);
            graph.Services.DefaultServiceFor<ThreeSettings>().Value.ShouldBeTheSameAs(threeSettings);
        }
        public void all_explicitly_changed_settings_should_get_registered_as_a_service()
        {
            var registry = new FubuRegistry();

            var oneSettings = new OneSettings();
            registry.ReplaceSettings(oneSettings);
            var twoSettings = new TwoSettings();
            registry.ReplaceSettings(twoSettings);
            var threeSettings = new ThreeSettings();
            registry.ReplaceSettings(threeSettings);

            using (var runtime = registry.ToRuntime())
            {
                var container = runtime.Get<IContainer>();
                container.DefaultRegistrationIs(oneSettings);
                container.DefaultRegistrationIs(twoSettings);
                container.DefaultRegistrationIs(threeSettings);
            }
        }
Exemplo n.º 3
0
        public void all_explicitly_changed_settings_should_get_registered_as_a_service()
        {
            var registry = new FubuRegistry();

            var oneSettings = new OneSettings();

            registry.ReplaceSettings(oneSettings);
            var twoSettings = new TwoSettings();

            registry.ReplaceSettings(twoSettings);
            var threeSettings = new ThreeSettings();

            registry.ReplaceSettings(threeSettings);

            var graph = BehaviorGraph.BuildFrom(registry);

            graph.Services.DefaultServiceFor <OneSettings>().Value.ShouldBeTheSameAs(oneSettings);
            graph.Services.DefaultServiceFor <TwoSettings>().Value.ShouldBeTheSameAs(twoSettings);
            graph.Services.DefaultServiceFor <ThreeSettings>().Value.ShouldBeTheSameAs(threeSettings);
        }
Exemplo n.º 4
0
        public void all_explicitly_changed_settings_should_get_registered_as_a_service()
        {
            var registry = new FubuRegistry();

            var oneSettings = new OneSettings();

            registry.ReplaceSettings(oneSettings);
            var twoSettings = new TwoSettings();

            registry.ReplaceSettings(twoSettings);
            var threeSettings = new ThreeSettings();

            registry.ReplaceSettings(threeSettings);

            using (var runtime = registry.ToRuntime())
            {
                var container = runtime.Get <IContainer>();
                container.DefaultRegistrationIs(oneSettings);
                container.DefaultRegistrationIs(twoSettings);
                container.DefaultRegistrationIs(threeSettings);
            }
        }