public void Equals_DifferentKeys_AreNotEqual()
 {
     var key1 = new JavascriptAssetKey {
         Browser = IE.Version.IE6,
         Equality = IE.Equality.LessThan,
         IsExternal = true
     };
     var key2 = new JavascriptAssetKey {
         Browser = IE.Version.IE5,
         Equality = IE.Equality.LessThan,
         IsExternal = true
     };
     Assert.IsFalse(key1.Equals(key2));
 }
 public void Equals_IdenticalKeys_AreEqual()
 {
     var key1 = new JavascriptAssetKey {
         Browser = IE.Version.IE5,
         Equality = IE.Equality.LessThan,
         IsExternal = true
     };
     var key2 = new JavascriptAssetKey {
         Browser = IE.Version.IE5,
         Equality = IE.Equality.LessThan,
         IsExternal = true
     };
     Assert.IsTrue(key1.Equals(key2));
 }
        public void Equals_AllPropertiesAreTakenIntoAccount()
        {
            var key1 = new JavascriptAssetKey();
            var key2 = new JavascriptAssetKey();
            Assert.IsTrue(key1.Equals(key2));

            key1.Browser = IE.Version.IE6;
            Assert.IsFalse(key1.Equals(key2));
            key2.Browser = IE.Version.IE6;
            Assert.IsTrue(key1.Equals(key2));

            key1.Equality = IE.Equality.GreaterThan;
            Assert.IsFalse(key1.Equals(key2));
            key2.Equality = IE.Equality.GreaterThan;
            Assert.IsTrue(key1.Equals(key2));

            key1.IsExternal = true;
            Assert.IsFalse(key1.Equals(key2));
            key2.IsExternal = true;
            Assert.IsTrue(key1.Equals(key2));
        }
 public void Equals_NullKey_DoesNotEqualNonNullKey()
 {
     var key1 = new JavascriptAssetKey();
     Assert.IsFalse(key1.Equals(null));
 }
 public void Equals_CssKey_DoesNotEqualJavascriptKey()
 {
     var key1 = new JavascriptAssetKey { IsExternal = true };
     var key2 = new CssAssetKey { IsExternal = true };
     Assert.IsFalse(key1.Equals(key2));
 }
 public void GetHashCode_SimilarKeys_HaveDifferentHashCodes()
 {
     var key1 = new JavascriptAssetKey { Browser = (IE.Version) 2 };
     var key2 = new JavascriptAssetKey { Equality = (IE.Equality) 2};
     Assert.That(key1.GetHashCode(), Is.Not.EqualTo(key2.GetHashCode()));
 }
 public void GetHashCode_IdenticalKeys_HaveSameHashCode()
 {
     var key = new JavascriptAssetKey {
         Browser = IE.Version.IE5,
         Equality = IE.Equality.LessThan,
         IsExternal = true
     };
     var key2 = new JavascriptAssetKey {
         Browser = IE.Version.IE5,
         Equality = IE.Equality.LessThan,
         IsExternal = true
     };
     Assert.AreEqual(key.GetHashCode(), key2.GetHashCode());
 }
 public void GetHashCode_DifferentKeys_HaveDifferentHashCode()
 {
     var key = new JavascriptAssetKey {
         Browser = IE.Version.IE6,
         Equality = IE.Equality.LessThan,
         IsExternal = true
     };
     var key2 = new JavascriptAssetKey {
         Browser = IE.Version.IE5,
         Equality = IE.Equality.LessThan,
         IsExternal = true
     };
     Assert.AreNotEqual(key.GetHashCode(), key2.GetHashCode());
 }
 public void GetHashCode_CssAssetKey_HasDifferentHashCodeThanCssAsset()
 {
     var key = new JavascriptAssetKey { IsExternal = true };
     var cssKey = new CssAssetKey { IsExternal = true };
     Assert.That(key.GetHashCode(), Is.Not.EqualTo(cssKey.GetHashCode()));
 }
 public void GetHashCode_AllPropertiesAreTakenIntoAccount()
 {
     var key = new JavascriptAssetKey();
     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));
 }