[Test]
public void TestCase ()
{
int numHerb = 10;
//fails, and in the failure, I can see the numHerb value
Assert.AreEqual("Whatever",numHerb.ToString());
// outputs nothing, or anywhere I can see
Debug.WriteLine("Herbivores start {0}", numHerb.ToString());
}
I’m running the unit tests through “Unity Test Runner”.
The last line still doesn’t show output even if it’s run by itself (the exception being thrown by the failed test isn’t the culprit for the output not showing to console).
Another hack I’m using is debugging the unit test, just attach monodevelop to the unity editor then run the unit test in Unity, and i can look at all the objects that way. Would be nice to just see output though, without an explicit fail.
Assert.AreEqual(“Whatever”,numHerb.ToString(), “OMG! Whatever is not equal to numHerb!” );
You can add a third parameter that prints to the console if the Assert fails. I don’t know if this is what you are looking for, but I find it pretty useful.