コード例 #1
0
        public void TestEquals()
        {
            Blah a = new Blah("abc", 1);
            Blah b = new Blah(string.Format("ab{0}", 'c'), 1);

            Assert.AreEqual(a.Equals(b), true, "#01");
        }
コード例 #2
0
ファイル: ValueTypeTest.cs プロジェクト: nlhepler/mono
		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");
		}
コード例 #3
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");
        }
コード例 #4
0
ファイル: ValueTypeTest.cs プロジェクト: nlhepler/mono
		public void TestEquals ()
		{
			Blah a = new Blah ("abc", 1);
			Blah b = new Blah (string.Format ("ab{0}", 'c'), 1);
			Assert.AreEqual (a.Equals (b), true, "#01");
		}