public static void WriteCommand_WhenValueChanges_HashesChange() { WriteCommand[] infos = new WriteCommand[] { new WriteCommand() { fileName = "Test" }, new WriteCommand() { internalName = "Test2" }, new WriteCommand() { serializeObjects = new List <SerializationInfo>() { new SerializationInfo() } }, new WriteCommand() { serializeObjects = new List <SerializationInfo>() { new SerializationInfo() { serializationIndex = 2 } } } }; HashSet <Hash128> set = new HashSet <Hash128>(infos.Select(x => HashingHelpers.GetHash128(x))); Assert.AreEqual(infos.Length, set.Count); }
public static void AssetLoadInfo_WhenValueChanges_HashesChange() { AssetLoadInfo[] infos = new AssetLoadInfo[] { new AssetLoadInfo() { address = "Test" }, new AssetLoadInfo() { asset = GUID.Generate() }, new AssetLoadInfo() { includedObjects = new List <ObjectIdentifier>() { new ObjectIdentifier() } }, new AssetLoadInfo() { referencedObjects = new List <ObjectIdentifier>() { new ObjectIdentifier() } } }; HashSet <Hash128> set = new HashSet <Hash128>(infos.Select(x => HashingHelpers.GetHash128(x))); Assert.AreEqual(infos.Length, set.Count); }
public static void PreloadInfo_WhenValueChanges_HashesChange() { ObjectIdentifier obj1 = new ObjectIdentifier(); obj1.SetFilePath("TestPath"); PreloadInfo[] infos = new PreloadInfo[] { new PreloadInfo() { preloadObjects = new List <ObjectIdentifier>() }, new PreloadInfo() { preloadObjects = new List <ObjectIdentifier>() { new ObjectIdentifier() } }, new PreloadInfo() { preloadObjects = new List <ObjectIdentifier>() { obj1 } }, }; HashSet <Hash128> set = new HashSet <Hash128>(infos.Select(x => HashingHelpers.GetHash128(x))); Assert.AreEqual(infos.Length, set.Count); }
public static void AssetBundleInfo_WhenValueChanges_HashesChange() { AssetBundleInfo[] infos = new AssetBundleInfo[] { new AssetBundleInfo() { bundleName = "Test" }, new AssetBundleInfo() { bundleName = "Test2" }, new AssetBundleInfo() { bundleAssets = new List <AssetLoadInfo>() { new AssetLoadInfo() { address = "a1" } } }, new AssetBundleInfo() { bundleAssets = new List <AssetLoadInfo>() { new AssetLoadInfo() { address = "a2" } } } }; HashSet <Hash128> set = new HashSet <Hash128>(infos.Select(x => HashingHelpers.GetHash128(x))); Assert.AreEqual(infos.Length, set.Count); }
public static void SerializationInfo_WhenValueChanges_HashesChange() { ObjectIdentifier obj1 = new ObjectIdentifier(); obj1.SetFilePath("TestPath"); SerializationInfo[] infos = new SerializationInfo[] { new SerializationInfo() { serializationIndex = 0 }, new SerializationInfo() { serializationIndex = 1 }, new SerializationInfo() { serializationIndex = 0, serializationObject = obj1 } }; HashSet <Hash128> set = new HashSet <Hash128>(infos.Select(x => HashingHelpers.GetHash128(x))); Assert.AreEqual(infos.Length, set.Count); }