Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }