Beispiel #1
0
        public void IsUpToDate_IndexOutOfDate_ReturnsCorrect()
        {
            // PREPARE THE TEST
            // setup the default mocks
            MockRepository mocks = new MockRepository();

            var target = new Index()
            {
                 IndexEntries = new List<ArticleSummary> { ArticleSummaryTest.CreateArticleSummaryTest() } 
            };

            var reader = mocks.DynamicMock<IDnaDataReader>();
            reader.Stub(x => x.HasRows).Return(true);
            reader.Stub(x => x.Read()).Return(false);

            var creator = mocks.DynamicMock<IDnaDataReaderCreator>();
            creator.Stub(x => x.CreateDnaDataReader("cachegettimeofmostrecentguideentry")).Return(reader);
            mocks.ReplayAll();

            Assert.AreEqual(false, target.IsUpToDate(creator));
        }