コード例 #1
0
        public void TestGetHashCodeWithNullProperties()
        {
            Account account = TestObjectBuilder.GetAccountWithNullProperties();

            try
            {
                int hashCode = account.GetHashCode();
            }
            catch (Exception ex)
            {
                Assert.Fail("An exception was thrown when generating a hash code:  " + ex.ToString());
            }
        }
コード例 #2
0
        public void TestEqualityWithNullProperties()
        {
            Account account1 = TestObjectBuilder.GetAccountWithNullProperties();
            Account account2 = TestObjectBuilder.GetAccount1();

            try
            {
                bool isEqual = account1.Equals(account2);
                isEqual = account2.Equals(account1);
            }
            catch (Exception ex)
            {
                Assert.Fail("An exception was thrown when testing equality:  " + ex.ToString());
            }
        }