Пример #1
0
        public void TestLoggingOnMethodWithArguments()
        {
            var b = new Beer();

            //reset logger
            Logger.Reset();
            //make sure the logger is at count == 0
            Assert.AreEqual(Logger.Log.Count, 0);

            //drink beer :)
            b.Drop(false);

            //make sure the beer is alright
            Assert.IsTrue(b.Empty);
            Assert.IsFalse(b.Full);
            Assert.IsTrue(b.Dropped);

            //The number of log messages must be ok
            Assert.AreEqual(Logger.Log.Count, 2);
            //the log must contain correct info
            Assert.AreEqual("Before LoggingAmender.Logger.Drop(false)", Logger.Log[0]);
            Assert.AreEqual("After LoggingAmender.Logger.Drop(false)", Logger.Log[1]);
        }