示例#1
0
 public void RegisterDefaults(BuildSession session)
 {
     foreach (var pair in _children)
     {
         session.RegisterDefault(pair.Key, pair.Value);
     }
 }
        public void when_retrieving_by_try_get_instance_for_instance_that_does_exist()
        {
            var session    = new BuildSession();
            var theService = new ColorService("red");

            session.RegisterDefault(typeof(IService), theService);

            session.TryGetInstance <IService>().ShouldBeTheSameAs(theService);
        }
示例#3
0
        public void SetUp()
        {
            PluginCache.ResetAll();
            builder  = PluginCache.FindBuilder(typeof(ClassWithMixOfSetters));
            instance = new SmartInstance <ClassWithMixOfSetters>().WithCtorArg("Age").EqualTo(34);
            _session = new BuildSession();

            TheDefaultGateway = new DefaultGateway();
            _session.RegisterDefault(typeof(IGateway), TheDefaultGateway);

            _target = null;
        }
        public void when_retrieving_by_try_get_instance_for_instance_that_does_exist()
        {
            var session = new BuildSession();
            var theService = new ColorService("red");
            session.RegisterDefault(typeof (IService), theService);

            session.TryGetInstance<IService>().ShouldBeTheSameAs(theService);
        }