示例#1
0
 // ReSharper disable once ParameterOnlyUsedForPreconditionCheck.Local - tests that DI passes a value.
 // ReSharper disable once UnusedMember.Local - invoked by DI.
 public void Deps1(Dep1 dep)
 {
     if (dep == null)
     {
         throw new ArgumentNullException(nameof(dep));
     }
 }
 public DefaultGroupCommandFactory(Dep1 d1, Dep2 d2, Dep3 d3, Dep4 d4, Dep5 d5)
 {
     _d1 = d1;
     _d2 = d2;
     _d3 = d3;
     _d4 = d4;
     _d5 = d5;
 }
示例#3
0
        public void ExternalInstances()
        {
            var d1      = new Dep1();
            var builder = new ContainerBuilder();

            builder.Register(d1);
            builder.Register <Dep3>();
            var container = builder.Build();

            Assert.Same(d1, container.Resolve <Dep1>());
            Assert.Same(d1, container.Resolve <Dep3>().Dep1);
        }
示例#4
0
 public CtroFooBar(Dep0 dep0, Dep1 dep1, Dep2 dep2)
 {
     if (dep0 == null)
     {
         throw new ArgumentNullException(nameof(dep0));
     }
     if (dep1 == null)
     {
         throw new ArgumentNullException(nameof(dep1));
     }
     if (dep2 == null)
     {
         throw new ArgumentNullException(nameof(dep2));
     }
 }
示例#5
0
        public void FuncTests_Resolve_ParameterInjection_Mixed()
        {
            var container = new StashboxContainer();

            container.RegisterType <FuncTest3>();
            container.RegisterType <FuncTest4>();
            container.RegisterType <Dep2>();
            container.RegisterType <Dep4>();
            var inst = container.Resolve <FuncTest3>();

            var d1 = new Dep1();
            var d3 = new Dep3();

            var d = inst.Dep(d1, d3);

            var d12 = new Dep1();

            Assert.AreNotSame(d1, d.Dep(d12).Dep);
            Assert.AreSame(d12, d.Dep(d12).Dep);
        }
 public GetGroupsCommand(AggregateResult <string> result, Dep1 d1, Dep4 d4)
 {
     _result = result;
     _d1     = d1;
     _d4     = d4;
 }
 void StObjConstruct(Dep1 d)
 {
     Dep1 = d;
 }
 public Car1FactoryParams(Dep1, Dep2, Dep3) 
 { 
    this.Dep1 = Dep1;
 public AudioChannelViewModel(Channel channel, Dep1 dep1, Dep2 dep2, Dep3 dep3)
 {
示例#10
0
 public DepMultipleCtor2(Dep1 d1)
 {
     throw new Exception("Wrong constructor selected");
 }
 public TestClass(Dep1 test1)
 {
     test = test1;
 }
示例#12
0
 public DepMultipleCtor1(Dep1 d, Dep2 d2)
 {
 }
示例#13
0
 public DepMultipleCtor1(Dep1 d1)
 {
 }
示例#14
0
 class DepCycle3 { public DepCycle3(DepCycle4 d, Dep1 d1)
                   {
                   }
示例#15
0
 internal class DepA { public DepA(Dep1 d)
                       {
                       }
示例#16
0
 public Dep3(Dep1 d1)
 {
     Dep1 = d1;
 }
示例#17
0
 public Dep2(Dep1 dep)
 {
     Dep = dep;
 }
示例#18
0
 public Test(Dep1 dep)
 {
     Dep1 = dep;
 }