Beispiel #1
0
        public void TupleValueTest()
        {
            TupleValue <Int32, Int32> pair = new TupleValue <int, int>(55, 555);

            Assert.AreEqual("Item1 = 55; Item2 = 555; ", pair.ToString());
            TupleValue <Int32, Int32> pair2 = new TupleValue <int, int>(55, 55);

            TupleValue <Int32, Int32> pair3 = new TupleValue <int, int>(55, 555);

            Assert.AreEqual(pair3.GetHashCode(), pair.GetHashCode());
            Assert.AreNotEqual(pair3.GetHashCode(), pair2.GetHashCode());

            Assert.AreEqual(true, pair3.Equals(pair));
            Assert.AreEqual(false, pair3.Equals(pair2));
        }