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 } }
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); } }