Silverlight unit test framework – updated source and binaries now available
The latest release of the Silverlight Unit Test Framework is now available for download. This release contains a few simple bug fixes and was built with the RTM version of the Silverlight Tools.
Download it today!
- Binaries and control sample tests, part of the Silverlight Toolkit download
(you’ll find the bits in the .\Source\Binaries\ directory) - Unit test framework binaries only
- Source code
This interim release corrected a few simple issues that customers have reported, and is included along with the December 2008 release of the Silverlight Toolkit. Changes of note:
- Asynchronous exception handling fixes and improvements
- [Priority(...)] attribute from VSTT is now supported. They receive implicit Tag values of PriorityN, where N is the integer priority.
- WorkItemTest type: EnqueueDelay method added, has two method signatures that accept either the milliseconds to delay, or a TimeSpan object.
- EnqueueCallback has a new overload that takes a number of Action parameters, for easy action chaining
- Enqueue has been marked as obsolete: please use EnqueueCallback, for consistency
- EnqueueSleep has been marked as obsolete: please use EnqueueDelay, which is a more clear name
- Silverlight test service fixes, you can now run test applications from a web server in more scenarios
- Silverlight test service can co-exist with other web servers and hosts
Hope this helps.
I still have problems with making crossdomain webrequests to servers that I run from my test project, but runs fine in a webapplication. Using a Flash policy file instead of clientaccesspolicy.xml seems to do the trick though, but I don’t always have that control. i have < domain uri=”*” >> set as well as allowed all headers. Fiddler does report the request for clientaccesspolicy.xml, but no more requests are made to that endpoint.
Let me know if you want more details.
@Morten,
I hear you – I’ve noticed something similar, but in the opposite – I’ve had to use the Silverlight clientaccesspolicy.xml file -instead- of the Flash! Argh.
To be honest the underlying code is all just WebClient code, so it is most likely a Silverlight-level issue that is probably being looked into. I’ll follow up with that team.
Are you at least somewhat unblocked and able to get some work done?
It’s not that blocking an issue (now that I already spent the hours to nail down the problem), and I’m trying to get them to put the flash file on their server. But I suspect I’m far from the last one to hit this problem.
Maybe my clientaccesspolicyfile.xml file is wrong, but as far as I can tell, it’s as wide open as it can get. Could you post the one you had success with?
Here’s mine (not sure if your blog will allow XML):
I guess not. Here it is with brackets instead:
[?xml version="1.0" encoding="utf-8" ?]
[access-policy]
[cross-domain-access]
[policy]
[allow-from http-request-headers="*"]
[domain uri="*"/]
[/allow-from]
[grant-to]
[resource include-subpaths="true" path="/"/]
[/grant-to]
[/policy]
[/cross-domain-access]
[/access-policy]
Hi Jeff .
I’ve been using the first testing framework released with SL2.0 beta.
When I updated to the SL 2.0 Release version the testing stoped working. I hadn’t have a chance to look into it , and now you have a new release (together with the toolkit ?).
Are there any special issues / requirments for users upgrading from the previous version ?
Thanks
Amit
[...] http://www.jeff.wilcox.name/2008/12/09/silverlight-unit-testing-december-2008/ Filed under: Silverlight [...]
@Amit,
What exception messages are you receiving in Visual Studio when attached and trying to run your tests with the latest version?
Hi Jeff ,
I found this post : http://www.jeff.wilcox.name/2008/09/29/unit-testing-rc0-changes/
Everything is working.
Thanks
Amit
Is there any fix for the crossdomain call issue or any work around? My current work around is to use another ASP.Net application project to run the test project.
Thanks,
Jun
I’ve found very little documentation on EnqueueConditional. I was hoping to lookup the source as linked, however I am getting a permission denied alert box. Perhaps you could answer my question. When the conditional is being evaluated I imagine there is some kind of looping check. What happens if the conditional is never met? I ran a quick test and it appears as if the test will just spin forever.
Also, I’m trying to find a way to easily tell when my WebClient request has returned, I have been resorting to checking for a change in the DOM elements that the web service would be modifying, but, if my server request fails those changes will never happen and I will be stuck in an infinite loop as per my example.
Have you had to overcome this type of issue, and if so how did you do it?
Thank you muchly!