Esempio n. 1
0
        public void TestCacheViaCode()
        {
            IServiceA serviceA = _container[typeof(IServiceA)] as IServiceA;

            serviceA.MyMethod(2, 5.5M);
            string consoleContents = _outWriter.GetStringBuilder().ToString();

            serviceA.MyMethodNotcached("Gilles");

            serviceA.MyMethod(2, 5.5M);
            Assert.AreEqual(consoleContents, _outWriter.GetStringBuilder().ToString());
        }
Esempio n. 2
0
        public void TestFicoCache()
        {
            IServiceA serviceA = _container[typeof(IServiceA)] as IServiceA;
            IServiceC serviceC = _container[typeof(IServiceC)] as IServiceC;

            serviceA.MyMethod(2, 5.5M);
            string consoleContents = _outWriter.GetStringBuilder().ToString();

            serviceC.MyMethod(2, 5.5M);

            ResetConsoleOut();

            WaitOneMillisecond();

            serviceA.MyMethod(2, 5.5M);
            Assert.IsFalse(consoleContents == _outWriter.GetStringBuilder().ToString());
        }