public void Scanner_apply_should_only_register_two_instances() { var scanner = new GenericConnectionScanner(typeof(ISomeServiceOf <>)); var registry = new Registry(); var graph = new PluginGraph(); scanner.Process(typeof(SomeService1), registry); scanner.Process(typeof(SomeService2), registry); scanner.Apply(graph); graph .AllInstances(typeof(ISomeServiceOf <string>)) .Count() .ShouldEqual(2); }
public void GenericConnectionScanner_can_match_on_it() { typeof(BirdBaseImpl).CanBeCastTo <IBird <Bird> >() .ShouldBeTrue(); var scanner = new GenericConnectionScanner(typeof(IBird <>)); scanner.Process(typeof(BirdBaseImpl), new Registry()); }