diff --git a/test/PhoneNumbers.Tests/GeographicPhoneNumberTests.cs b/test/PhoneNumbers.Tests/GeographicPhoneNumberTests.cs index ff19bc2f..2102c0ca 100644 --- a/test/PhoneNumbers.Tests/GeographicPhoneNumberTests.cs +++ b/test/PhoneNumbers.Tests/GeographicPhoneNumberTests.cs @@ -187,14 +187,19 @@ public void Inequality() Assert.False(phoneNumber1 == phoneNumber4); Assert.True(phoneNumber1 != phoneNumber4); - + // change country var phoneNumber5 = new GeographicPhoneNumber(PhoneNumberHint.None) { Country = CountryInfo.France, - GeographicArea = "N/A", - NationalDestinationCode = null, - NationalSignificantNumber = "12345667788", - SubscriberNumber = "667788", + GeographicArea = phoneNumber1.GeographicArea, + NationalDestinationCode = phoneNumber1.NationalDestinationCode, + NationalSignificantNumber = phoneNumber1.NationalSignificantNumber, + SubscriberNumber = phoneNumber1.SubscriberNumber, }; + + Assert.NotEqual(phoneNumber1, phoneNumber5); + Assert.False(phoneNumber1.Equals(phoneNumber5)); + Assert.False(phoneNumber1 == phoneNumber5); + Assert.True(phoneNumber1 != phoneNumber5); } } diff --git a/test/PhoneNumbers.Tests/MobilePhoneNumberTests.cs b/test/PhoneNumbers.Tests/MobilePhoneNumberTests.cs index 9e7e1bd6..e1b0ec9b 100644 --- a/test/PhoneNumbers.Tests/MobilePhoneNumberTests.cs +++ b/test/PhoneNumbers.Tests/MobilePhoneNumberTests.cs @@ -157,5 +157,19 @@ public void Inequality() Assert.False(phoneNumber1.Equals(phoneNumber4)); Assert.False(phoneNumber1 == phoneNumber4); Assert.True(phoneNumber1 != phoneNumber4); + + // change country + var phoneNumber5 = new MobilePhoneNumber(PhoneNumberHint.None) + { + Country = CountryInfo.France, + NationalDestinationCode = phoneNumber1.NationalDestinationCode, + NationalSignificantNumber = phoneNumber1.NationalSignificantNumber, + SubscriberNumber = phoneNumber1.SubscriberNumber, + }; + + Assert.NotEqual(phoneNumber1, phoneNumber5); + Assert.False(phoneNumber1.Equals(phoneNumber5)); + Assert.False(phoneNumber1 == phoneNumber5); + Assert.True(phoneNumber1 != phoneNumber5); } } diff --git a/test/PhoneNumbers.Tests/NonGeographicPhoneNumberTests.cs b/test/PhoneNumbers.Tests/NonGeographicPhoneNumberTests.cs index 95efbf95..3737d3ea 100644 --- a/test/PhoneNumbers.Tests/NonGeographicPhoneNumberTests.cs +++ b/test/PhoneNumbers.Tests/NonGeographicPhoneNumberTests.cs @@ -209,5 +209,19 @@ public void Inequality() Assert.False(phoneNumber1.Equals(phoneNumber4)); Assert.False(phoneNumber1 == phoneNumber4); Assert.True(phoneNumber1 != phoneNumber4); + + // change country + var phoneNumber5 = new NonGeographicPhoneNumber(PhoneNumberHint.None) + { + Country = CountryInfo.France, + NationalDestinationCode = phoneNumber1.NationalDestinationCode, + NationalSignificantNumber = phoneNumber1.NationalSignificantNumber, + SubscriberNumber = phoneNumber1.SubscriberNumber, + }; + + Assert.NotEqual(phoneNumber1, phoneNumber5); + Assert.False(phoneNumber1.Equals(phoneNumber5)); + Assert.False(phoneNumber1 == phoneNumber5); + Assert.True(phoneNumber1 != phoneNumber5); } }