public void Fill_in_argument_by_type_with_Container() { var container = new Container(x => x.For <IView>().Use <View>()); var theNode = new SpecialNode(); var theTrade = new Trade(); var command = container .With(typeof(Node), theNode) .With(theTrade) .GetInstance <Command>(); command.View.ShouldBeOfType <View>(); theNode.ShouldBeTheSameAs(command.Node); theTrade.ShouldBeTheSameAs(command.Trade); }
public void Fill_in_argument_by_type_with_ObjectFactory() { ObjectFactory.Initialize(x => { x.For <IView>().Use <View>(); }); var theNode = new SpecialNode(); var theTrade = new Trade(); var command = ObjectFactory.Container .With(typeof(Node), theNode) .With(theTrade) .GetInstance <Command>(); command.View.ShouldBeOfType <View>(); theNode.ShouldBeTheSameAs(command.Node); theTrade.ShouldBeTheSameAs(command.Trade); }
public void Fill_in_argument_by_type_with_ObjectFactory() { ObjectFactory.Initialize(x => { x.For<IView>().Use<View>(); }); var theNode = new SpecialNode(); var theTrade = new Trade(); var command = ObjectFactory.Container .With(typeof (Node), theNode) .With(theTrade) .GetInstance<Command>(); command.View.ShouldBeOfType<View>(); theNode.ShouldBeTheSameAs(command.Node); theTrade.ShouldBeTheSameAs(command.Trade); }
public void Fill_in_argument_by_type() { var container = new Container(x => { x.For<IView>().Use<View>(); }); var theNode = new SpecialNode(); var theTrade = new Trade(); var command = container .With(typeof (Node), theNode) .With(theTrade) .GetInstance<Command>(); command.View.ShouldBeOfType<View>(); theNode.ShouldBeTheSameAs(command.Node); theTrade.ShouldBeTheSameAs(command.Trade); }