libphonenumber-csharp / csharp / PhoneNumbers.Test / TestBuildMetadataFromXml.cs

Diff from to

csharp/PhoneNumbers.Test/TestBuildMetadataFromXml.cs

             XmlElement territoryElement = parseXmlString("<territory/>");
 
             var phoneNumberDesc = BuildMetadataFromXml.ProcessPhoneNumberDescElement(
-                null, territoryElement, "invalidType");
+                null, territoryElement, "invalidType", false);
             Assert.AreEqual("NA", phoneNumberDesc.PossibleNumberPattern);
             Assert.AreEqual("NA", phoneNumberDesc.NationalNumberPattern);
         }
             XmlElement territoryElement = parseXmlString("<territory><fixedLine/></territory>");
 
             var phoneNumberDesc = BuildMetadataFromXml.ProcessPhoneNumberDescElement(
-                generalDesc, territoryElement, "fixedLine");
+                generalDesc, territoryElement, "fixedLine", false);
             Assert.AreEqual("\\d{6}", phoneNumberDesc.PossibleNumberPattern);
         }
 
             XmlElement territoryElement = parseXmlString(xmlInput);
 
             var phoneNumberDesc = BuildMetadataFromXml.ProcessPhoneNumberDescElement(
-                generalDesc, territoryElement, "fixedLine");
+                generalDesc, territoryElement, "fixedLine", false);
             Assert.AreEqual("\\d{6}", phoneNumberDesc.PossibleNumberPattern);
         }
 
         [Test]
         public void TestProcessPhoneNumberDescElementHandlesLiteBuild()
         {
-            try
-            {
-                BuildMetadataFromXml.LiteBuild = true;
-                String xmlInput =
-                    "<territory><fixedLine>" +
-                    "  <exampleNumber>01 01 01 01</exampleNumber>" +
-                    "</fixedLine></territory>";
-                XmlElement territoryElement = parseXmlString(xmlInput);
-                var phoneNumberDesc = BuildMetadataFromXml.ProcessPhoneNumberDescElement(
-                    null, territoryElement, "fixedLine");
-                Assert.AreEqual("", phoneNumberDesc.ExampleNumber);
-            }
-            finally
-            {
-                // Restore the lite build parameter to its default value (false) to avoid potential
-                // side-effects in other tests.
-                BuildMetadataFromXml.LiteBuild = false;
-            }
+            String xmlInput =
+                "<territory><fixedLine>" +
+                "  <exampleNumber>01 01 01 01</exampleNumber>" +
+                "</fixedLine></territory>";
+            XmlElement territoryElement = parseXmlString(xmlInput);
+            var phoneNumberDesc = BuildMetadataFromXml.ProcessPhoneNumberDescElement(
+                null, territoryElement, "fixedLine", true);
+            Assert.AreEqual("", phoneNumberDesc.ExampleNumber);
         }
 
         [Test]
             XmlElement territoryElement = parseXmlString(xmlInput);
 
             var phoneNumberDesc = BuildMetadataFromXml.ProcessPhoneNumberDescElement(
-                null, territoryElement, "fixedLine");
+                null, territoryElement, "fixedLine", false);
             Assert.AreEqual("01 01 01 01", phoneNumberDesc.ExampleNumber);
         }
 
             XmlElement countryElement = parseXmlString(xmlInput);
 
             var phoneNumberDesc = BuildMetadataFromXml.ProcessPhoneNumberDescElement(
-                null, countryElement, "fixedLine");
+                null, countryElement, "fixedLine", false);
             Assert.AreEqual("\\d{6}", phoneNumberDesc.PossibleNumberPattern);
         }
 
             XmlElement territoryElement = parseXmlString(xmlInput);
             PhoneMetadata.Builder metadata = new PhoneMetadata.Builder();
             // Should set sameMobileAndFixedPattern to true.
-            BuildMetadataFromXml.LoadGeneralDesc(metadata, territoryElement);
+            BuildMetadataFromXml.LoadGeneralDesc(metadata, territoryElement, false);
             Assert.True(metadata.SameMobileAndFixedLinePattern);
         }
 
                  "</territory>";
             XmlElement territoryElement = parseXmlString(xmlInput);
             PhoneMetadata.Builder metadata = new PhoneMetadata.Builder();
-            BuildMetadataFromXml.LoadGeneralDesc(metadata, territoryElement);
+            BuildMetadataFromXml.LoadGeneralDesc(metadata, territoryElement, false);
             Assert.AreEqual("\\d{1}", metadata.FixedLine.NationalNumberPattern);
             Assert.AreEqual("\\d{2}", metadata.Mobile.NationalNumberPattern);
             Assert.AreEqual("\\d{3}", metadata.Pager.NationalNumberPattern);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.