Пример #1
0
        public void BuildCharsStats_Empty()
        {
            var target = new StatService();
            var result = target.BuildCharsStats(null, null);

            Assert.IsNotNull(result);
            Assert.AreEqual(result.TotalCharsInText, 0);
            Assert.IsNull(result.AllCharsOrderedByAppearance);
        }
Пример #2
0
        public void BuildCharsStats_Positive()
        {
            var target = new StatService();
            var result = target.BuildCharsStats(_totalText, _chars);

            Assert.IsNotNull(result);
            Assert.AreEqual(result.TotalCharsInText, _totalText.Length);
            Assert.IsNotNull(result.AllCharsOrderedByAppearance);
            Assert.AreEqual(result.AllCharsOrderedByAppearance.ElementAtOrDefault(0)?.AChar, 'e');
            Assert.AreEqual(result.AllCharsOrderedByAppearance.ElementAtOrDefault(4)?.AChar, 'a');
        }