I would like to log output test data when running test with the Silverlight Unit Testing Framework. I could go around it by creating some element and writing it on that however this feels like a hacked way. Is there开发者_开发百科 any framework supported way of writing output during testing?
Looks like the basic code was all there in the April2010 toolkit but never quite finished. The idea is to have your TestClass have a TestContext TestContext {get; set;}
property that the framework will automatically set. Then, in a TestMethod, call TestContext.WriteLine()
In the visual output for a test method, there is a "Output" section but it's databinding was set to a property that did not exist. I've created patch 10660 to address the issue. Hopefully it will be fixed for SL5's release. http://www.codeplex.com/Download?ProjectName=silverlight&DownloadId=295575
Copy the patch's files over April 2010 Silverlight Toolkit unzipped Infrastructure.zip, replacing originals, and build your own copy of Microsoft.Silverlight.Testing.dll
The next release of the Silverlight Toolkit (after the October 2009 release) will have an experimental componen, used by the team, for this purpose. Though I can't commit to a date, I envision this happening in the current calendar year.
You can leverage StatLight to get console report, XML report, or integrate with teamcity.
Try using Lighthouse Silverlight Unit Test Runner
It works out of the box and provides standardized xml results file, and also outputs rich logging to the console.
精彩评论