コード例 #1
0
        public void GetHashCode_JavascriptAssetKey_HasDifferentHashCodeThanCssAsset()
        {
            var key = new CssAssetKey {
                IsExternal = true
            };
            var jsKey = new JavascriptAssetKey {
                IsExternal = true
            };

            Assert.That(key.GetHashCode(), Is.Not.EqualTo(jsKey.GetHashCode()));
        }
コード例 #2
0
        public void GetHashCode_AllPropertiesAreTakenIntoAccount()
        {
            var key = new CssAssetKey {
                Media = "media1"
            };
            var hash1 = key.GetHashCode();

            key.Browser = IE.Version.IE6;
            var hash2 = key.GetHashCode();

            Assert.That(hash1, Is.Not.EqualTo(hash2));
            key.Equality = IE.Equality.LessThan;
            var hash3 = key.GetHashCode();

            Assert.That(hash1, Is.Not.EqualTo(hash3));
            Assert.That(hash2, Is.Not.EqualTo(hash3));
            key.IsExternal = true;
            var hash4 = key.GetHashCode();

            Assert.That(hash1, Is.Not.EqualTo(hash4));
            Assert.That(hash2, Is.Not.EqualTo(hash4));
            Assert.That(hash3, Is.Not.EqualTo(hash4));
        }
コード例 #3
0
        public void GetHashCode_DifferentKeys_HaveDifferentHashCode()
        {
            var key = new CssAssetKey {
                Media      = "media1",
                Browser    = IE.Version.IE6,
                Equality   = IE.Equality.LessThan,
                IsExternal = true
            };
            var key2 = new CssAssetKey {
                Media      = "media1",
                Browser    = IE.Version.IE5,
                Equality   = IE.Equality.LessThan,
                IsExternal = true
            };

            Assert.AreNotEqual(key.GetHashCode(), key2.GetHashCode());
        }