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); }
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'); }