public void CacheIsLocalToSubclass()
 {
     StringWriter sw = new StringWriter();
     FormatterOne f1 = new FormatterOne();
     FormatterTwo f2 = new FormatterTwo();
     DateTime dt1 = DateTime.Today.AddMinutes(10);
     f1.FormatDate(dt1, sw);
     f2.FormatDate(dt1, sw);
     Assert.AreEqual(2, FormatterOne.invocations);
 }
示例#2
0
        public void CacheIsLocalToSubclass()
        {
            StringWriter sw  = new StringWriter();
            FormatterOne f1  = new FormatterOne();
            FormatterTwo f2  = new FormatterTwo();
            DateTime     dt1 = DateTime.Today.AddMinutes(10);

            f1.FormatDate(dt1, sw);
            f2.FormatDate(dt1, sw);
            Assert.AreEqual(2, FormatterOne.invocations);
        }