public void find_family_for_concrete_type_with_default() { PluginGraph graph = PluginGraph.Empty(); graph.Families[typeof(BigThingy)].GetDefaultInstance() .ShouldBeOfType <ConstructorInstance>() .PluggedType.ShouldEqual(typeof(BigThingy)); }
public void has_family_true_with_simple() { var graph = PluginGraph.Empty(); graph.AddFamily(new PluginFamily(typeof(IThingy))); graph.HasFamily(typeof(IThingy)).ShouldBeTrue(); }
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>)); }
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(); }
public void has_family_false_with_simple() { var graph = PluginGraph.Empty(); graph.HasFamily(typeof(IThingy)).ShouldBeFalse(); }