Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to log output in the Silverlight Unit Testing Framework?

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?

like image 603
Gergely Orosz Avatar asked Oct 26 '22 00:10

Gergely Orosz


1 Answers

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

like image 111
foson Avatar answered Nov 14 '22 11:11

foson