Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TrevorPilley committed Nov 3, 2024
1 parent 7a1fb1e commit a7a635d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test/PhoneNumbers.Tests/GeographicPhoneNumberTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
14 changes: 14 additions & 0 deletions test/PhoneNumbers.Tests/MobilePhoneNumberTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
14 changes: 14 additions & 0 deletions test/PhoneNumbers.Tests/NonGeographicPhoneNumberTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit a7a635d

Please sign in to comment.