I'm writing unit tests for a code generator, and most of my tests compare output that spans several lines against some golden output. Currently, I'm comparing outputs with Assert.AreEqual(string, string) which displays the context around the first difference.
Unfortunately, this isn't very helpful. Ideally, I'd like to get a diff of the outputs. What is the best way of doing this? My current plan is to write the generated code to a file and call the executable referenced by the DIFFTOOL env var (else diff.exe from PATH, else the default NUnit behavior) and call Assert.Fail() with an appropriate message.