Example #1
0
 static void Main(string[] args)
 {
     ConstructorInjection _ConstructorInjection = new ConstructorInjection(new ConsoleTraceSource());
       _ConstructorInjection.Alpha();
       _ConstructorInjection.Bravo();
       _ConstructorInjection.Charlie();
       _ConstructorInjection.Delta();
       Console.ReadLine();
 }
Example #2
0
        static void Main(string[] args)
        {
            ConstructorInjection _ConstructorInjection = new ConstructorInjection(new ConsoleTraceSource());

            _ConstructorInjection.Alpha();
            _ConstructorInjection.Bravo();
            _ConstructorInjection.Charlie();
            _ConstructorInjection.Delta();
            Console.ReadLine();
        }
Example #3
0
        public void ConstructorInjectionTest()
        {
            InMemoryTraceSource  _TraceSource          = new InMemoryTraceSource();
            ConstructorInjection _ConstructorInjection = new ConstructorInjection(_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();
        }