public void RegisterAndFindServicesOnTheExplicitArgument()
        {
            var args = new ExplicitArguments();

            Assert.IsNull(args.Get <IProvider>());

            var red = new RedProvider();

            args.Set <IProvider>(red);

            Assert.AreSame(red, args.Get <IProvider>());

            args.Set <IExplicitTarget>(new RedTarget());
            Assert.IsInstanceOfType(typeof(RedTarget), args.Get <IExplicitTarget>());
        }
Ejemplo n.º 2
0
        public void RegisterAndFindServicesOnTheExplicitArgument()
        {
            var args = new ExplicitArguments();

            args.Get <IProvider>().ShouldBeNull();

            var red = new RedProvider();

            args.Set <IProvider>(red);

            red.ShouldBeTheSameAs(args.Get <IProvider>());

            args.Set <IExplicitTarget>(new RedTarget());
            args.Get <IExplicitTarget>().ShouldBeOfType <RedTarget>();
        }
Ejemplo n.º 3
0
        public void RegisterAndFindServicesOnTheExplicitArgument()
        {
            var args = new ExplicitArguments();
            Assert.IsNull(args.Get<IProvider>());

            var red = new RedProvider();
            args.Set<IProvider>(red);

            Assert.AreSame(red, args.Get<IProvider>());

            args.Set<IExplicitTarget>(new RedTarget());
            args.Get<IExplicitTarget>().ShouldBeOfType<RedTarget>();
        }