Пример #1
0
 public void Test_5()
 {
     using (var app = new AzosApplication(null, BAD_CONF))
     {
         var obj = new NeedsOne();//This only requires A but not B
         app.InjectInto(obj);
         Aver.AreEqual(100, obj.A.ValueOfA);
         Aver.IsNull(obj.B);//OPTIONAL dependency
     }
 }
Пример #2
0
 public void Test_6()
 {
     using (var app = new AzosApplication(null, BASE_CONF))
     {
         var obj = new NeedsOne();//This only requires A but not B, but if B is there it will inject it
         app.InjectInto(obj);
         Aver.AreEqual(100, obj.A.ValueOfA);
         Aver.IsNotNull(obj.B);//OPTIONAL dependency IS injected WHEN available
         Aver.AreEqual(-1000, obj.B.ValueOfB);
     }
 }