コード例 #1
0
        public void CanGetAllKeyWordsFromAssemblyTest()
        {
            var words = CheckKeywordsHandler.GetAllKeyWords();

            Assert.IsTrue(words.Any());

            var languages = new string[] { "C#", "javascript" };

            Assert.IsTrue(words.All(i => languages.Contains(i.Language)));

            var keywords = new string[] { "abstract", "object", "while", "break", "if", "yield" };

            Assert.IsTrue(keywords.Intersect(words.SelectMany(i => i.Keywords)).All(i => keywords.Contains(i)));

            var saveWords = new string[] { "add", "global", "var", "enum", "goto", "volatile" };

            Assert.IsTrue(keywords.Intersect(words.SelectMany(i => i.Keywords)).All(i => keywords.Contains(i)));
        }
コード例 #2
0
 public static List <string> GetAllProgramNames()
 {
     return(CheckKeywordsHandler.GetAllKeyWords().Select(t => t.Language).ToList());
 }