A data cache that does not cache anything. For test.
Inheritance: IDataCache
Example #1
0
        public void DataRetrieverRetrieveFailTest()
        {
            IDataCache dataCache = new NullDataCache();
            IRequestGenerator requestGenerator = new WebRequestGenerator();

            ResultEventArgs<Listings> resultEventArgs = null;

            using (AutoResetEvent waitEvent = new AutoResetEvent(false))
            {
                DataRetriever dataRetriever = new DataRetriever(dataCache, requestGenerator);

                EventHandler<ResultEventArgs<Listings>> completedHandler = (sender, res) =>
                {
                    resultEventArgs = res;
                    waitEvent.Set();
                };

                dataRetriever.StartRetrieve(new Uri(TestUri + "bad"), completedHandler);
                bool signalled = waitEvent.WaitOne(Constants.WaitTimeout);

                Assert.IsTrue(signalled);
            }

            Assert.IsNotNull(resultEventArgs);
            Assert.IsFalse(resultEventArgs.ResultStatus.Success);
        }
Example #2
0
        public void DataRetrieverCreateWithParamsTest()
        {
            IDataCache dataCache = new NullDataCache();
            IRequestGenerator requestGenerator = new WebRequestGenerator();

            DataRetriever dataRetriever = new DataRetriever(dataCache, requestGenerator);
            Assert.IsNotNull(dataRetriever);
        }