예제 #1
0
		public void TestGetHash ()
		{
			Blah a = new Blah ("abc", 1);
			Blah b = new Blah (string.Format ("ab{0}", 'c'), 1);
			Assert.AreEqual (a.GetHashCode (), b.GetHashCode (), "#01");

			Lalala la = new Lalala ("abc", 1);
			Lalala lb = new Lalala (string.Format ("ab{0}", 'c'), 1);
			Assert.AreEqual (la.GetHashCode (), lb.GetHashCode (), "#02");

			a = new Blah (null, 1);
			b = new Blah (null, 1);
			Assert.AreEqual (la.GetHashCode (), lb.GetHashCode (), "#03");

			la = new Lalala (null, 1);
			lb = new Lalala (null, 1);
			Assert.AreEqual (la.GetHashCode (), lb.GetHashCode (), "#04");
		}
예제 #2
0
        public void TestGetHash()
        {
            Blah a = new Blah("abc", 1);
            Blah b = new Blah(string.Format("ab{0}", 'c'), 1);

            Assert.AreEqual(a.GetHashCode(), b.GetHashCode(), "#01");

            Lalala la = new Lalala("abc", 1);
            Lalala lb = new Lalala(string.Format("ab{0}", 'c'), 1);

            Assert.AreEqual(la.GetHashCode(), lb.GetHashCode(), "#02");

            a = new Blah(null, 1);
            b = new Blah(null, 1);
            Assert.AreEqual(la.GetHashCode(), lb.GetHashCode(), "#03");

            la = new Lalala(null, 1);
            lb = new Lalala(null, 1);
            Assert.AreEqual(la.GetHashCode(), lb.GetHashCode(), "#04");
        }