public void PropertyInjectionTest() { InMemoryTraceSource _TraceSource = new InMemoryTraceSource(); PropertyInjection _ConstructorInjection = new PropertyInjection() { TraceSource = _TraceSource }; _ConstructorInjection.Alpha(); Assert.AreEqual<int>(1, _TraceSource._callStack.Count); _ConstructorInjection.Bravo(); Assert.AreEqual<int>(2, _TraceSource._callStack.Count); _ConstructorInjection.Charlie(); Assert.AreEqual<int>(3, _TraceSource._callStack.Count); _ConstructorInjection.Delta(); Assert.AreEqual<int>(4, _TraceSource._callStack.Count); _TraceSource.CheckConsistency(); _ConstructorInjection.TraceSource = new DoNothingTraceSource(); _ConstructorInjection.Alpha(); _ConstructorInjection.Bravo(); _ConstructorInjection.Charlie(); _ConstructorInjection.Delta(); Assert.AreEqual<int>(4, _TraceSource._callStack.Count); }
public void PropertyInjectionTest() { InMemoryTraceSource _TraceSource = new InMemoryTraceSource(); PropertyInjection _ConstructorInjection = new PropertyInjection() { TraceSource = _TraceSource }; _ConstructorInjection.Alpha(); Assert.AreEqual <int>(1, _TraceSource._callStack.Count); _ConstructorInjection.Bravo(); Assert.AreEqual <int>(2, _TraceSource._callStack.Count); _ConstructorInjection.Charlie(); Assert.AreEqual <int>(3, _TraceSource._callStack.Count); _ConstructorInjection.Delta(); Assert.AreEqual <int>(4, _TraceSource._callStack.Count); _TraceSource.CheckConsistency(); _ConstructorInjection.TraceSource = new DoNothingTraceSource(); _ConstructorInjection.Alpha(); _ConstructorInjection.Bravo(); _ConstructorInjection.Charlie(); _ConstructorInjection.Delta(); Assert.AreEqual <int>(4, _TraceSource._callStack.Count); }
public void NoTracerDefinedTestMethod() { PropertyInjection _PropertyInjection = new PropertyInjection(); _PropertyInjection.Alpha(); }