public void Test_CountCharOccurencesLinq_CorrectlyCountsOccurencesOfEachCharacterInAString_WhenCalled() { // Arrange // Arrange StringSorter sorter = new StringSorter(); string message = "ddfffabb"; int dExpected = 2, fExpected = 3, aExpected = 1, bExpected = 2; // Act Dictionary <char, int> dictionaryResult = sorter.CountCharOccurencesLinq(message); int aResult, bResult, dResult, fResult; dictionaryResult.TryGetValue('a', out aResult); dictionaryResult.TryGetValue('b', out bResult); dictionaryResult.TryGetValue('d', out dResult); dictionaryResult.TryGetValue('f', out fResult); // Assert Assert.AreEqual(aExpected, aResult); Assert.AreEqual(bExpected, bResult); Assert.AreEqual(dExpected, dResult); Assert.AreEqual(fExpected, fResult); }