예제 #1
0
        public void find_family_for_concrete_type_with_default()
        {
            PluginGraph graph = PluginGraph.Empty();

            graph.Families[typeof(BigThingy)].GetDefaultInstance()
            .ShouldBeOfType <ConstructorInstance>()
            .PluggedType.ShouldEqual(typeof(BigThingy));
        }
예제 #2
0
        public void has_family_true_with_simple()
        {
            var graph = PluginGraph.Empty();

            graph.AddFamily(new PluginFamily(typeof(IThingy)));

            graph.HasFamily(typeof(IThingy)).ShouldBeTrue();
        }
예제 #3
0
        public void find_family_by_closing_an_open_interface_that_matches()
        {
            PluginGraph graph = PluginGraph.Empty();

            graph.Families[typeof(IOpen <>)].SetDefault(new ConfiguredInstance(typeof(Open <>)));

            graph.Families[typeof(IOpen <string>)].GetDefaultInstance().ShouldBeOfType <ConstructorInstance>()
            .PluggedType.ShouldEqual(typeof(Open <string>));
        }
예제 #4
0
        public void has_family_true_with_open_generics()
        {
            var graph = PluginGraph.Empty();

            graph.Families[typeof(IOpen <>)].SetDefault(new ConstructorInstance(typeof(Open <>)));

            graph.HasFamily(typeof(IOpen <string>))
            .ShouldBeTrue();
        }
예제 #5
0
        public void has_family_false_with_simple()
        {
            var graph = PluginGraph.Empty();

            graph.HasFamily(typeof(IThingy)).ShouldBeFalse();
        }