StatePrinter icon indicating copy to clipboard operation
StatePrinter copied to clipboard

Weird output of data structure

Open kbilsted opened this issue 9 years ago • 1 comments

curly style output of

public class TagsCollection
{
    public Dictionary<string, List<string>> Pages = new Dictionary<string, List<string>>();

    public void Add(string tag, string url)
    {
        List<string> urls;
        if (!Pages.TryGetValue(tag, out urls))
            Pages.Add(tag, urls = new List<string>());
        urls.Add(url);
    }
}

becomes

var expected = @"new TagsCollection()
{
    Pages[""Design""] = new List<String>()
    Pages[0] = ""Articles\Design\MalleableCodeUsingDecorators.md""
    Pages[""SOLID""] = new List<String>()
    Pages[0] = ""Articles\Design\MalleableCodeUsingDecorators.md""
    Pages[1] = ""BookReviews\Adaptive Code via CS.md""
    Pages[""Single_Responsibility_Principle""] = new List<String>()
    Pages[0] = ""Articles\Design\MalleableCodeUsingDecorators.md""
    Pages[""Design_Pattern""] = new List<String>()
    Pages[0] = ""Articles\Design\MalleableCodeUsingDecorators.md""
    Pages[""Decorator""] = new List<String>()
    Pages[0] = ""Articles\Design\MalleableCodeUsingDecorators.md""
    Pages[""Wrapper""] = new List<String>()
    Pages[0] = ""Articles\Design\MalleableCodeUsingDecorators.md""
    Pages[""Cache""] = new List<String>()
    Pages[0] = ""Articles\Design\MalleableCodeUsingDecorators.md""
    Pages[""Book_Review""] = new List<String>()
    Pages[0] = ""BookReviews\Adaptive Code via CS.md""
}";

kbilsted avatar Jul 12 '15 12:07 kbilsted

this bug may very well have been solved in 3.0 - need to check

kbilsted avatar May 07 '16 19:05 kbilsted