public void testSub() { MSubDependency07.AllInstances.subGenerate = _ => 123; Class07 clazz = new Class07(); Assert.AreEqual(2 * 333, clazz.generate()); Assert.AreEqual(2 * 123, clazz.subGenerate()); Assert.AreEqual(2 * 999, clazz.superGenerate()); }
public void testSuper() { // does not compile: MSubDependency07.AllInstances.superGenerate = _ => 123; MSuperDependency07.AllInstances.superGenerate = _ => 123; Class07 clazz = new Class07(); Assert.AreEqual(2 * 333, clazz.generate()); Assert.AreEqual(2 * 333, clazz.subGenerate()); Assert.AreEqual(2 * 123, clazz.superGenerate()); }