示例#1
0
 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);
 }
示例#2
0
        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);
        }
示例#3
0
 public void NoTracerDefinedTestMethod()
 {
     PropertyInjection _PropertyInjection = new PropertyInjection();
       _PropertyInjection.Alpha();
 }
示例#4
0
        public void NoTracerDefinedTestMethod()
        {
            PropertyInjection _PropertyInjection = new PropertyInjection();

            _PropertyInjection.Alpha();
        }