Example #1
0
        public void CompareTo_OtherHasDifferentKey_SortsOnKey()
        {
            FingerprintContribution contribution1 = new FingerprintContribution("abc", "MyValue");
            FingerprintContribution contribution2 = new FingerprintContribution("xyz", "MyValue");

            Assert.IsTrue(contribution1.CompareTo(contribution2) < 0);
            Assert.AreEqual(0, contribution1.CompareTo(contribution1));
            Assert.IsTrue(contribution2.CompareTo(contribution1) > 0);
        }
Example #2
0
        public void CompareTo_OtherHasSameKey_SortsOnValue()
        {
            FingerprintContribution contribution1 = new FingerprintContribution("MyKey", "abc");
            FingerprintContribution contribution2 = new FingerprintContribution("MyKey", "xyz");

            Assert.IsTrue(contribution1.CompareTo(contribution2) < 0);
            Assert.AreEqual(0, contribution1.CompareTo(contribution1));
            Assert.IsTrue(contribution2.CompareTo(contribution1) > 0);
        }
Example #3
0
        public void CompareTo_OtherIsNull_ThrowsArgumentNullException()
        {
            FingerprintContribution contribution = new FingerprintContribution("abc", "xyz");

            try
            {
                contribution.CompareTo(null);
            }
            catch (ArgumentNullException e)
            {
                Assert.AreEqual("other", e.ParamName);
                throw;
            }
        }