Пример #1
0
        public void ProblemLanguages_KeepsAsteriskMatch()
        {
            var  checker    = new LicenseChecker();
            var  inputLangs = new String[] { "en", "fr", "ru", "zh-CN" };
            var  key        = "kingstone.superbible.ruth";
            bool didCheck;
            IEnumerable <string> result = checker.GetProblemLanguages(inputLangs, key, out didCheck);

            Assert.That(didCheck, Is.True);
            Assert.That(result, Does.Contain("en"));
            Assert.That(result, Does.Contain("fr"));
            Assert.That(result, Does.Not.Contain("ru"));
            Assert.That(result, Does.Not.Contain("zh-CN"));
        }
Пример #2
0
        private static LicenseChecker SimpleTest(bool expectCheck)
        {
            var checker = new LicenseChecker();
            // bjn, at the time of writing, has a spurious newline, and comes back as bjn\n.
            // That might change in the online version but should stay true in the offline data below.
            var  inputLangs = new String[] { "en", "bjn" };
            var  key        = "kingstone.superbible.ruth";
            bool didCheck;
            IEnumerable <string> result = checker.GetProblemLanguages(inputLangs, key, out didCheck);

            Assert.That(didCheck, Is.EqualTo(expectCheck));
            if (didCheck)
            {
                Assert.That(result, Does.Contain("en"));
                Assert.That(result, Does.Not.Contain("bjn"));
            }

            return(checker);
        }