AssertNotChanged() public method

public AssertNotChanged ( string text ) : void
text string
return void
Ejemplo n.º 1
0
        public void SyntaxRegexListRowBrTagStart()
        {
            Assert.AreEqual("x\r\n*abc", parser.FixBrParagraphs("x<br>\r\n*abc"));
            Assert.AreEqual("x\r\n*abc", parser.FixBrParagraphs("x<br> \r\n*abc"));
            Assert.AreEqual("x\r\n*abc", parser.FixBrParagraphs("x<br/> \r\n*abc"));
            Assert.AreEqual("x\r\n*abc", parser.FixBrParagraphs("x<br /> \r\n*abc"));
            Assert.AreEqual("x\r\n*abc", parser.FixBrParagraphs("x<br / > \r\n*abc"));

            genFixes.AssertNotChanged(@"{{{Foo|
param=<br>
**text
**text1 }}");

            Assert.AreEqual(@"** Blog x

'''No", parser.FixBrParagraphs(@"** Blog x
<br>
<br>
'''No"));
        }
Ejemplo n.º 2
0
        public void TestYearRangesCategories()
        {
            genFixes.AssertNotChanged(@"now foo
[[Category:Abc (2004-present)]]");

            genFixes.AssertChange(@"now abc (2004-present) was
now foo
[[Category:Abc (2004-present)]]", @"now abc (2004–present) was
now foo
[[Category:Abc (2004-present)]]");
        }
Ejemplo n.º 3
0
        public void TestFixNonBreakingSpaces()
        {
            Assert.AreEqual(@"a 50&nbsp;km road", parser.FixNonBreakingSpaces(@"a 50 km road"));
            Assert.AreEqual(@"a 50&nbsp;m (170&nbsp;ft) road", parser.FixNonBreakingSpaces(@"a 50 m (170 ft) road"));
            Assert.AreEqual(@"a 50.2&nbsp;m (170&nbsp;ft) road", parser.FixNonBreakingSpaces(@"a 50.2 m (170 ft) road"));
            Assert.AreEqual(@"a long (50&nbsp;km) road", parser.FixNonBreakingSpaces(@"a long (50 km) road"));
            Assert.AreEqual(@"a 50&nbsp;km road", parser.FixNonBreakingSpaces(@"a 50km road"));
            Assert.AreEqual(@"a 50&nbsp;kg dog", parser.FixNonBreakingSpaces(@"a 50 kg dog"));
            Assert.AreEqual(@"a 50&nbsp;kg dog", parser.FixNonBreakingSpaces(@"a 50kg dog"));

            Assert.AreEqual(@"a 50&nbsp;Hz rod", parser.FixNonBreakingSpaces(@"a 50Hz rod"));
            Assert.AreEqual(@"a 50&nbsp;kHz rod", parser.FixNonBreakingSpaces(@"a 50kHz rod"));

            Assert.AreEqual(@"a 50&nbsp;cm road", parser.FixNonBreakingSpaces(@"a 50 cm road"));
            Assert.AreEqual(@"a 50&nbsp;cm road", parser.FixNonBreakingSpaces(@"a 50cm road"));
            Assert.AreEqual(@"a 50.247&nbsp;cm road", parser.FixNonBreakingSpaces(@"a 50.247cm road"));
            Assert.AreEqual(@"a 50.247&nbsp;nm laser", parser.FixNonBreakingSpaces(@"a 50.247nm laser"));
            Assert.AreEqual(@"a 50.247&nbsp;mm pen", parser.FixNonBreakingSpaces(@"a 50.247 mm pen"));
            Assert.AreEqual(@"a 50.247&nbsp;nm laser", parser.FixNonBreakingSpaces(@"a 50.247  nm laser"));
            Assert.AreEqual(@"a 50.247&nbsp;µm laser", parser.FixNonBreakingSpaces(@"a 50.247µm laser"));
            Assert.AreEqual(@"a 50.247&nbsp;cd light", parser.FixNonBreakingSpaces(@"a 50.247 cd light"));
            Assert.AreEqual(@"a 50.247&nbsp;cd light", parser.FixNonBreakingSpaces(@"a 50.247cd light"));
            Assert.AreEqual(@"a 50.247&nbsp;mmol solution", parser.FixNonBreakingSpaces(@"a 50.247mmol solution"));
            Assert.AreEqual(@"a 0.3&nbsp;mol solution", parser.FixNonBreakingSpaces(@"a 0.3mol solution"));
            Assert.AreEqual(@"a 50.247&nbsp;kW laser", parser.FixNonBreakingSpaces(@"a 50.247 kW laser"));
            Assert.AreEqual(@"a 50.247&nbsp;mW laser", parser.FixNonBreakingSpaces(@"a 50.247 mW laser"));
            Assert.AreEqual(@"a 50&nbsp;m/s car", parser.FixNonBreakingSpaces(@"a 50m/s car"));
            Assert.AreEqual(@"at 5&nbsp;°C today", parser.FixNonBreakingSpaces(@"at 5°C today"));
            Assert.AreEqual(@"at 5&nbsp;°C today", parser.FixNonBreakingSpaces(@"at 5 °C today"));
            Assert.AreEqual(@"at 55&nbsp;°F today", parser.FixNonBreakingSpaces(@"at 55°F today"));
            Assert.AreEqual(@"at 55&nbsp;°F today", parser.FixNonBreakingSpaces(@"at 55  °F today"));
            Assert.AreEqual(@"at 55&nbsp;°F today", parser.FixNonBreakingSpaces(@"at 55 °F today"), "invisible nbsp (Unicode U+00A0) before unit");

            Assert.AreEqual(@"a 50.2&nbsp;m (170&nbsp;ft) road", parser.FixNonBreakingSpaces(@"a 50.2 m (170 ft) road"), "invisible nbsp (Unicode U+00A0) before m and ft");

            // no changes for these
            genFixes.AssertNotChanged(@"nearly 5m people");
            genFixes.AssertNotChanged(@"nearly 5 in 10 people");
            genFixes.AssertNotChanged(@"a 3CD set");
            genFixes.AssertNotChanged(@"its 3 feet are");
            genFixes.AssertNotChanged(@"http://site.com/View/3356 A show");
            genFixes.AssertNotChanged(@"a 50&nbsp;km road");
            genFixes.AssertNotChanged(@"over $200K in cash");
            genFixes.AssertNotChanged(@"now {{a 50kg dog}} was");
            genFixes.AssertNotChanged(@"now a [[50kg dog]] was");
            genFixes.AssertNotChanged(@"now “a 50kg dog” was");
            genFixes.AssertNotChanged(@"now <!--a 50kg dog--> was");
            genFixes.AssertNotChanged(@"now <nowiki>a 50kg dog</nowiki> was");
            genFixes.AssertNotChanged(@"*[http://site.com/blah_20cm_long Site here]");
            genFixes.AssertNotChanged(@"a 50 gram rod");
            genFixes.AssertNotChanged(@"a long (50 foot) toad");

            // firearms articles don't use spaces for ammo sizes
            Assert.AreEqual(@"the 50mm gun", parser.FixNonBreakingSpaces(@"the 50mm gun"));

            // Imperial units
            Assert.AreEqual(@"a long (50&nbsp;in) toad", parser.FixNonBreakingSpaces(@"a long (50 in) toad"));
            Assert.AreEqual(@"a long (50&nbsp;ft) toad", parser.FixNonBreakingSpaces(@"a long (50 ft) toad"));

            Assert.AreEqual(@"a long (50&nbsp;in) toad", parser.FixNonBreakingSpaces(@"a long (50in) toad"));
            Assert.AreEqual(@"a long (50-52&nbsp;in) toad", parser.FixNonBreakingSpaces(@"a long (50-52in) toad"));
            Assert.AreEqual(@"a long (50–52&nbsp;in) toad", parser.FixNonBreakingSpaces(@"a long (50–52in) toad"));
            Assert.AreEqual(@"a long (50.5&nbsp;in) toad", parser.FixNonBreakingSpaces(@"a long (50.5 in) toad"));
            Assert.AreEqual(@"a big (50.5&nbsp;oz) toad", parser.FixNonBreakingSpaces(@"a big (50.5 oz) toad"));
        }