[TestMethod] public void testSetRelevantDescPatternsSetsAllDescriptionsForShortNumbers() { String xmlInput = "<territory ID=\"FR\">" + " <tollFree><nationalNumberPattern>\\d{1}</nationalNumberPattern></tollFree>" + " <standardRate><nationalNumberPattern>\\d{2}</nationalNumberPattern></standardRate>" + " <premiumRate><nationalNumberPattern>\\d{3}</nationalNumberPattern></premiumRate>" + " <shortCode><nationalNumberPattern>\\d{4}</nationalNumberPattern></shortCode>" + " <carrierSpecific>" + " <nationalNumberPattern>\\d{5}</nationalNumberPattern>" + " </carrierSpecific>" + "</territory>"; XmlElement territoryElement = parseXmlString(xmlInput); PhoneMetadata.Builder metadata = PhoneMetadata.newBuilder(); BuildMetadataFromXml.setRelevantDescPatterns(metadata, territoryElement, false /* liteBuild */, true /* isShortNumberMetadata */); Assert.AreEqual("\\d{1}", metadata.getTollFree().getNationalNumberPattern()); Assert.AreEqual("\\d{2}", metadata.getStandardRate().getNationalNumberPattern()); Assert.AreEqual("\\d{3}", metadata.getPremiumRate().getNationalNumberPattern()); Assert.AreEqual("\\d{4}", metadata.getShortCode().getNationalNumberPattern()); Assert.AreEqual("\\d{5}", metadata.getCarrierSpecific().getNationalNumberPattern()); }