public void GetUpdatedCacheEntry_ReturnsCacheEntryWithSameVersionAndHash_IfAssetHasNotChanged() { GUID guid = CreateTestTextAsset("mytext"); var entry1 = m_Cache.GetCacheEntry(guid, 2); m_Cache.ClearCacheEntryMaps(); var entry2 = m_Cache.GetUpdatedCacheEntry(entry1); Assert.AreEqual(entry1.Guid, entry2.Guid); Assert.AreEqual(entry1.File, entry2.File); Assert.AreEqual(entry1.Type, entry2.Type); Assert.AreEqual(entry1.Version, entry2.Version); Assert.AreEqual(entry1.Hash, entry2.Hash); }
public void WhenSerializedFileChanges_CachedVersionIsNotUsed() { ArchiveAndCompressBundles.TaskInput input = GetDefaultInput(); BuildCache cache = new BuildCache(); input.BuildCache = cache; AddSimpleBundle(input, "mybundle", "internalName"); ArchiveAndCompressBundles.Run(input, out ArchiveAndCompressBundles.TaskOutput output); string srcFile = input.InternalFilenameToWriteResults["internalName"].resourceFiles[0].fileName; CreateFileOfSize(srcFile, 2048); cache.SyncPendingSaves(); cache.ClearCacheEntryMaps(); ArchiveAndCompressBundles.Run(input, out ArchiveAndCompressBundles.TaskOutput output2); Assert.AreEqual(0, input.OutCachedBundles.Count); }