Exemplo n.º 1
0
        public void ClearAll()
        {
            var timeWatcherMock = new Mock <ITimeWatcher>();
            var watcherMock     = new Mock <IWatcher>();

            timeWatcherMock.Setup(r => r.StartWatcher(It.IsAny <string>(), It.IsAny <bool>()))
            .Returns(() => watcherMock.Object);
            var obj = new RepositoryCache();

            Assert.IsNotNull(obj);
            var result = obj.ClearAll(timeWatcherMock.Object);

            Assert.IsTrue(result);
            timeWatcherMock.Verify(foo => foo.StartWatcher("RepositoryCache.ClearAll", It.IsAny <bool>()), Times.Once());
        }