public void Test_Get_Export() { Lazy<IClassWithInteger> c = container.GetExport<IClassWithInteger>(); var p = new ToCompose(); Compose(p); Assert.IsTrue(Object.ReferenceEquals(c.Value, p.ClassWithInteger)); }
public void Contract_Object_Composition_Test() { // create instance to compose var p = new ToCompose(); // perform composition Compose(p); // value is set Assert.AreEqual(5, p.ClassWithInteger.IntegerValue); }
public void Compose_Contract_Value_Test() { // create instance to compose ToCompose c1 = new ToCompose(); // Integer value is 0 (default) Assert.AreEqual(0, c1.IntegerValue); // perform composition Compose(c1); // Integer value is now 5 Assert.AreEqual(8, c1.IntegerValue); }