public void DownloadHashFile_PresentInCache()
        {
            mockEffectiveStrategy.SetupGet(x => x.CanDownloadHashFile).Returns(true);
            var pathInCache = sut.GetHashFilePathInCache("42.0");

            mockFileProxy.Setup(x => x.FileExists(pathInCache)).Returns(true);

            var hashFilePath = sut.DownloadHashFile("42.0");

            Assert.That(hashFilePath, Is.EqualTo(pathInCache));
            mockEffectiveStrategy.Verify(x => x.DownloadHashFile(It.IsAny <string>()), Times.Never);
        }
Esempio n. 2
0
        public void DownloadHashFile_PresentInCache()
        {
            mockEffectiveStrategy.SetupGet(x => x.CanDownloadHashFile).Returns(true);
            var pathInCache = sut.GetHashFilePathInCache("42.0");

            mockFileProxy.Setup(x => x.FileExists(pathInCache)).Returns(true);
            mockFileProxy.Setup(x => x.ReadAllLines(pathInCache)).Returns(new[] { "123test" });

            var hashFile = sut.DownloadHashFile("42.0");

            Assert.That(hashFile.Content, Is.EquivalentTo(new [] { "123test" }));
            mockEffectiveStrategy.Verify(x => x.DownloadHashFile(It.IsAny <string>()), Times.Never);
        }