Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            log.Info("Main: **** Starting **********************************************************************************");
            SampleWorker worker = new SampleWorker
            {
                ConnectionString = "server=localhost;port=3306;database=prestashop;user=root;password="******"Main: **** Ending **********************************************************************************");
        }
        public void TestCachedWorker()
        {
            var _sampleWorker       = new SampleWorker();
            var _cachedServerWorker = new CachedServerWorker(_sampleWorker);

            Assert.AreEqual(0, _sampleWorker.GetReadsetsCallCounter);
            _cachedServerWorker.GetReadsets("a");
            Assert.AreEqual(1, _sampleWorker.GetReadsetsCallCounter);
            _cachedServerWorker.GetReadsets("a");
            Assert.AreEqual(1, _sampleWorker.GetReadsetsCallCounter);
            _cachedServerWorker.GetReadsets("b");
            Assert.AreEqual(2, _sampleWorker.GetReadsetsCallCounter);
            _cachedServerWorker.GetReadsets("b");
            Assert.AreEqual(2, _sampleWorker.GetReadsetsCallCounter);
        }