示例#1
0
        public void hash_code_is_predictable()
        {
            var key1 = new AssetNamesKey(new string[] { "a", "b", "c" });
            var key2 = new AssetNamesKey(new string[] { "a", "b", "c" });

            key1.GetHashCode().ShouldEqual(key2.GetHashCode());
            key1.GetHashCode().ShouldEqual(key2.GetHashCode());
            key1.GetHashCode().ShouldEqual(key2.GetHashCode());
            key1.GetHashCode().ShouldEqual(key2.GetHashCode());
            key1.GetHashCode().ShouldEqual(key2.GetHashCode());
        }
示例#2
0
        public void equals_is_not_order_dependent()
        {
            var key1 = new AssetNamesKey(new string[] { "a", "b", "c" });
            var key2 = new AssetNamesKey(new string[] { "b", "c", "a" });
            var key3 = new AssetNamesKey(new string[] { "d", "b", "c" });

            key1.ShouldEqual(key2);
            key2.ShouldEqual(key1);

            key3.ShouldNotEqual(key1);
            key1.ShouldNotEqual(key3);
        }
示例#3
0
        public void equals()
        {
            var key1 = new AssetNamesKey(new string[] { "a", "b", "c" });
            var key2 = new AssetNamesKey(new string[] { "a", "b", "c" });
            var key3 = new AssetNamesKey(new string[] { "d", "b", "c" });

            key1.ShouldEqual(key2);
            key2.ShouldEqual(key1);

            key3.ShouldNotEqual(key1);
            key1.ShouldNotEqual(key3);
        }