public void MaxChar() { MaxChar maxChar = new MaxChar(); string key = ""; int value = 0; var result = maxChar.ObterMaxChar("Hello There!"); foreach (var item in result) { if (value < item.Value) { key = item.Key.ToString(); value = item.Value; } } Assert.AreEqual("e", key); Assert.AreEqual(3, value); }
public void MaxCharSegundoExemplo() { MaxChar maxChar = new MaxChar(); string key = ""; int value = 0; var result = maxChar.ObterMaxChar("apple 1231111"); foreach (var item in result) { if (value < item.Value) { key = item.Key.ToString(); value = item.Value; } } Assert.AreEqual("1", key); Assert.AreEqual(5, value); }