示例#1
0
        public void TestConfigStore()
        {
            ConfigStore cfg       = ConfigStore.CreateConfig("en-gb");
            var         negations = cfg.Negations;

            string[] Negate =
            {
                "aint",     "arent",   "cannot",    "cant",     "couldnt",  "darent",   "didnt",   "doesnt",
                "ain't",    "aren't",  "can't",     "couldn't", "daren't",  "didn't",   "doesn't",
                "dont",     "hadnt",   "hasnt",     "havent",   "isnt",     "mightnt",  "mustnt",  "neither",
                "don't",    "hadn't",  "hasn't",    "haven't",  "isn't",    "mightn't", "mustn't",
                "neednt",   "needn't", "never",     "none",     "nope",     "nor",      "not",     "nothing","nowhere",
                "oughtnt",  "shant",   "shouldnt",  "uhuh",     "wasnt",    "werent",
                "oughtn't", "shan't",  "shouldn't", "uh-uh",    "wasn't",   "weren't",
                "without",  "wont",    "wouldnt",   "won't",    "wouldn't", "rarely",   "seldom",  "despite"
            };
            bool isExisting;

            Assert.AreEqual(negations.Length, Negate.Length);

            foreach (var a in negations)
            {
                isExisting = false;
                foreach (var b in Negate)
                {
                    if (a.Equals(b))
                    {
                        isExisting = true;
                        break;
                    }
                }
                Assert.IsTrue(isExisting);
            }
        }
示例#2
0
 public bool CreateConfig(ConfigModel model)
 {
     try
     {
         var configStore = new ConfigStore();
         var dt          = configStore.CreateConfig(model);
         if (dt)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }