Esempio n. 1
0
        public void TestTextUtils()
        {
            Assert.AreEqual($@"{Environment.NewLine}{Environment.NewLine}", TextUtils.DoubleNewLine);

            Assert.AreEqual(@"aeiouy aeiouy aeiou aeiou ao cn AEIOUY AEIOUY AEIOU AEIOU AO CN", TextUtils.RemoveDiacritics(@"áéíóúý äëïöüÿ àèìòù âêîôû ãõ çñ ÁÉÍÓÚÝ ÄËÏÖÜŸ ÀÈÌÒÙ ÂÊÎÔÛ ÃÕ ÇÑ"));

            Assert.AreEqual(@"NC*123", TextUtils.BuildSearchFilter(@" ñç  % 123  ", false, '*'));
            Assert.AreEqual(@"NC*123*", TextUtils.BuildSearchFilter(@" ñç .*  123 ??? ", false, '*'));
            Assert.AreEqual(@"*NC*123", TextUtils.BuildSearchFilter(@" %  ñç ? 123 ", false, '*'));

            Assert.AreEqual(@"*NC*123*", TextUtils.BuildSearchFilter(@" ñç  % 123  ", true, '*'));
            Assert.AreEqual(@"*NC*123*", TextUtils.BuildSearchFilter(@" ñç .*  123 ??? ", true, '*'));
            Assert.AreEqual(@"*NC*123*", TextUtils.BuildSearchFilter(@" %  ñç ? 123 ", true, '*'));
        }