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); }
public void GetStatModelAlphabeticalSortCheck_Correct() { var stat = CharStat.GetStatModel("abbbcc", true); Assert.IsTrue(stat.Pairs[0].Char == 'a' && stat.Pairs[2].Char == 'c'); }
public void GetStatModelFrequencySortCheck_Correct() { var stat = CharStat.GetStatModel("abbbcc"); Assert.IsTrue(stat.Pairs[0].Char == 'b' && stat.Pairs[2].Char == 'a'); }
public void GetStatModelNull_ListCountIsZero() { var stat = CharStat.GetStatModel(null); Assert.AreEqual(stat.Pairs.Count, 0); }
public void GetStatModelMultipleLanguage_Correct() { var stat = CharStat.GetStatModel("夢林玄解 維基電子版 幾乎全部都是亂1someother-text2что-тонарусском1"); Assert.AreEqual(stat.Pairs.Count, 34); }
public void GetStatModelEmptyString_ListCountIsZero() { var stat = CharStat.GetStatModel(""); Assert.AreEqual(stat.Pairs.Count, 0); }