public IEnumerator ContentAdded() { yield return(Cache()); var cacheReference = Autoya.Debug_Persist_HashCountByDomain( AutoyaFilePersistTestsFileDomain, 'l' ); var initialFilePaths = Autoya.Persist_DirectoryNamesInDomain(AutoyaFilePersistTestsFileDomain); var done = false; Autoya.Persist_CacheHashes( AutoyaFilePersistTestsFileDomain, "h e ll o w o r l d".Split(' '),// ll, added. () => { done = true; }, (code, reason) => { Fail("failed to cache items:" + reason); } ); yield return(WaitUntil( () => { return done; }, () => { throw new TimeoutException("timeout."); } )); var newInitialFilePaths = Autoya.Persist_DirectoryNamesInDomain(AutoyaFilePersistTestsFileDomain); True(initialFilePaths.Length == newInitialFilePaths.Length, "not match."); var targetPath = initialFilePaths.Where(p => p.EndsWith("l")).First(); var lFilePaths = Directory.GetFiles(targetPath); True(lFilePaths.Length == 2, "not match, expect:2, actual:" + lFilePaths.Length); cacheReference = Autoya.Debug_Persist_HashCountByDomain( AutoyaFilePersistTestsFileDomain, 'l' ); True(cacheReference == 2, "not match, cacheReference:" + cacheReference); }
public IEnumerator SameInitialCache() { var result = Autoya.Persist_IsExist(AutoyaFilePersistTestsFileDomain, AutoyaFilePersistTestsFileName); True(!result, "should not be exist."); var done = false; Autoya.Persist_CacheHashes( AutoyaFilePersistTestsFileDomain, "h e ll o w o r l d".Split(' '),// ll and l will be into same folder. () => { done = true; }, (code, reason) => { Fail("failed to cache items:" + reason); } ); yield return(WaitUntil( () => { return done; }, () => { throw new TimeoutException("timeout."); } )); var cacheReference = Autoya.Debug_Persist_HashCountByDomain( AutoyaFilePersistTestsFileDomain, 'l' ); True(cacheReference == 2, "not match, cacheReference:" + cacheReference); }