public void DictUtil_ConvertDictToSortedString_ConvertToInCorrectStringTrue() { var dict = new Dictionary<string, int> { { "this", 2 }, { "is", 2 }, { "a", 1 }, { "sentence", 1 }, { "so", 1 } }; var properString = "this - 2is - 2a - 1sentence - 1so - 1"; var dictUtil = new DictUtil("{0} - {1}", true); var computedString = dictUtil.ConvertDictToSortedString(dict); Assert.IsFalse(properString.Equals(computedString)); }
public void DictUtil_ConvertDictToSortedString_ConvertToInCorrectStringFalse() { var dict = new Dictionary<string, int> { { "this", 2 }, { "is", 2 }, { "a", 1 }, { "sentence", 1 }, { "so", 1 } }; var properString = "2 - this\n2 - is\n1 - a\n1 - sentence\n1 - so"; var dictUtil = new DictUtil("{1} - {0}", false); var computedString = dictUtil.ConvertDictToSortedString(dict); Assert.IsFalse(properString.Equals(computedString)); }