public void Match_IncrementalNonExistingKeys_ReturnValue() { var countryLookup = new CountryLookup(); countryLookup.Load(); var country = countryLookup.Match("XX"); Assert.That(country, Is.EqualTo("Unknown")); country = countryLookup.Match("YY"); Assert.That(country, Is.EqualTo("Unknown")); country = countryLookup.Match("ZZ"); Assert.That(country, Is.EqualTo("Unknown")); }
public void Match_IncrementalExistingKeys_ReturnValue() { var countryLookup = new CountryLookup(); countryLookup.Load(); var country = countryLookup.Match("US"); Assert.That(country, Is.EqualTo("United States of America")); country = countryLookup.Match("BE"); Assert.That(country, Is.EqualTo("Belgium")); country = countryLookup.Match("US"); Assert.That(country, Is.EqualTo("United States of America")); }
public void Match_NonExistingKey_ThrowException() { var countryLookup = new CountryLookup(); countryLookup.Load(); Assert.Throws <System.Collections.Generic.KeyNotFoundException>(() => countryLookup.Match("XX")); }
public void Match_IncrementalNonExistingKeys_IsReallyIncremental() { var countryLookup = new CountryLookup(); countryLookup.Load(); Assert.That(countryLookup.Count(), Is.EqualTo(0)); var country = countryLookup.Match("US"); Assert.That(countryLookup.Count(), Is.EqualTo(1)); country = countryLookup.Match("XX"); Assert.That(countryLookup.Count(), Is.EqualTo(1)); country = countryLookup.Match("US"); Assert.That(countryLookup.Count(), Is.EqualTo(1)); }