Exemple #1
0
        public void Can_GetAll_WithHugeNumbers_Success()
        {
            var props  = new { root = @"C:\tmp", pattern = "*.*", options = System.IO.SearchOption.AllDirectories };
            var repo   = new FileSystemRepo(props.root, props.pattern, props.options);
            var actual = repo.GetAll();

            Assert.IsNotNull(actual);
            Assert.IsTrue(actual.Count() > 10000);

            log.Variable("actual.Count()", actual.Count());
        }
Exemple #2
0
        public void Can_GetAll_Success()
        {
            var props    = new { root = @"C:\Repositories\Kasi.Tools.Harvester\test\Kasi.Tools.Harvester.Domain.Tests\Concrete\Repository", pattern = "FileSystemRepoTest.cs", options = System.IO.SearchOption.TopDirectoryOnly };
            var repo     = new FileSystemRepo(props.root, props.pattern, props.options);
            var actual   = repo.GetAll();
            var testfile = actual.FirstOrDefault();

            Assert.IsNotNull(actual);
            Assert.AreEqual(1, actual.Count());
            Assert.AreEqual(Path.Combine(props.root, props.pattern), testfile.FullFilePath);
        }
Exemple #3
0
        public void Can_LoadHashes_Success()
        {
            var props    = new { root = @"C:\Repositories\Kasi.Tools.Harvester\test\Kasi.Tools.Harvester.Domain.Tests\Concrete\Repository", pattern = "FileSystemRepoTest.cs", options = System.IO.SearchOption.TopDirectoryOnly };
            var repo     = new FileSystemRepo(props.root, props.pattern, props.options);
            var files    = repo.GetAll();
            var testfile = files.FirstOrDefault();

            var actual = testfile.LoadHashes();

            Assert.IsTrue(actual);

            Assert.AreEqual(Encryption.GetHash(Path.Combine(props.root, props.pattern)), testfile.FilelPathHash);
        }