public static ConvertToString ( object>.IDictionary | ||
dictionary | object>.IDictionary | The dictionary. |
separator | string | The separator to separate key value pairs. |
return | string |
public void ConvertDictionaryToString() { IDictionary <object, object> dictionary = new Dictionary <object, object>(); dictionary.Add("bla", "haha"); dictionary.Add(1, 25); dictionary.Add("exception", new Exception("exception")); string s = FormatHelper.ConvertToString(dictionary, "; "); s.Should().Be("bla=haha; 1=25; exception=System.Exception: exception"); }
public void ConvertCollectionToString() { string s = FormatHelper.ConvertToString(new object[] { 3, "hello", new Exception("exception") }, ", "); s.Should().Be("3, hello, System.Exception: exception"); }