Пример #1
0
        public void GetStatModel_Correct()
        {
            var stat = CharStat.GetStatModel("test");

            stat.Pairs.Single(x => x.Char == 't' && ((int)Math.Round(x.Frequency * 100)) == 50);
            stat.Pairs.Single(x => x.Char == 'e' && ((int)Math.Round(x.Frequency * 100)) == 25);
            stat.Pairs.Single(x => x.Char == 's' && ((int)Math.Round(x.Frequency * 100)) == 25);
            Assert.AreEqual(stat.Pairs.Count, 3);
        }
Пример #2
0
        public void GetStatModelAlphabeticalSortCheck_Correct()
        {
            var stat = CharStat.GetStatModel("abbbcc", true);

            Assert.IsTrue(stat.Pairs[0].Char == 'a' && stat.Pairs[2].Char == 'c');
        }
Пример #3
0
        public void GetStatModelFrequencySortCheck_Correct()
        {
            var stat = CharStat.GetStatModel("abbbcc");

            Assert.IsTrue(stat.Pairs[0].Char == 'b' && stat.Pairs[2].Char == 'a');
        }
Пример #4
0
        public void GetStatModelNull_ListCountIsZero()
        {
            var stat = CharStat.GetStatModel(null);

            Assert.AreEqual(stat.Pairs.Count, 0);
        }
Пример #5
0
        public void GetStatModelMultipleLanguage_Correct()
        {
            var stat = CharStat.GetStatModel("夢林玄解 維基電子版 幾乎全部都是亂1someother-text2что-тонарусском1");

            Assert.AreEqual(stat.Pairs.Count, 34);
        }
Пример #6
0
        public void GetStatModelEmptyString_ListCountIsZero()
        {
            var stat = CharStat.GetStatModel("");

            Assert.AreEqual(stat.Pairs.Count, 0);
        }