示例#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());
            }
        }