public void ParseLocation_InvalidCountryCode() { // Valid line, but not with our country code mapping... string line = "FK\t-5142-05751\tAtlantic/Stanley"; Assert.Throws <KeyNotFoundException>(() => TzdbZoneLocationParser.ParseLocation(line, SampleCountryMapping)); }
public void ParseLocation_Valid_WithComment() { string line = "GB\t+4000+03000\tEurope/London\tSome comment"; var location = TzdbZoneLocationParser.ParseLocation(line, SampleCountryMapping); Assert.AreEqual("GB", location.CountryCode); Assert.AreEqual("Britain (UK)", location.CountryName); Assert.AreEqual(40, location.Latitude); Assert.AreEqual(30, location.Longitude); Assert.AreEqual("Europe/London", location.ZoneId); Assert.AreEqual("Some comment", location.Comment); }
public void ParseLocation_InvalidLength(string line) { Assert.Throws <ArgumentException>(() => TzdbZoneLocationParser.ParseLocation(line, SampleCountryMapping)); }