コード例 #1
0
        public void Equals_HandlesTypesAndNulls()
        {
            var cp1 = new CountryPostalCode("BG", "1000");
            var cp2 = new CountryPostalCode("BG", "1000");
            var x = new object();

            Assert.AreEqual(true, cp1.Equals((object)cp2));
            Assert.AreNotEqual(true, cp1.Equals(x));
            Assert.AreNotEqual(true, cp1.Equals(null));
        }
コード例 #2
0
        public void Equals_HandlesTypesAndNulls()
        {
            var cp1 = new CountryPostalCode("BG", "1000");
            var cp2 = new CountryPostalCode("BG", "1000");
            var x   = new object();

            Assert.AreEqual(true, cp1.Equals((object)cp2));
            Assert.AreNotEqual(true, cp1.Equals(x));
            Assert.AreNotEqual(true, cp1.Equals(null));
        }
コード例 #3
0
        public void Equals(string country1, string code1, string country2, string code2, bool expectedResult)
        {
            var cp1 = new CountryPostalCode(country1, code1);
            var cp2 = new CountryPostalCode(country2, code2);

            Assert.AreEqual(expectedResult, cp1.Equals(cp2));
        }
コード例 #4
0
 public void Equals(string country1, string code1, string country2, string code2, bool expectedResult)
 {
     var cp1 = new CountryPostalCode(country1, code1);
     var cp2 = new CountryPostalCode(country2, code2);
     Assert.AreEqual(expectedResult, cp1.Equals(cp2));
 }