Running xunit tests in Silverlight–xunitcontrib-silverlight

by Matt 14. December 2010 12:14

If you want to write unit tests in Silverlight,  it’s a pretty solid bet that you’ll be using using Jeff Wilcox’s unit testing framework that ships with the Silverlight Toolkit. It’s essentially a port of mstest, combined with a Silverlight based test runner. Handily, the test runner allows for unit test providers, allowing us to plug in a different test framework.

And that’s exactly what the latest release of xunitcontrib is – a port of xUnit.net, and a provider for the unit testing framework.

image

It’s a pretty faithful port of xunit (i.e. with as few changes to the source as possible), and includes the majority of the features that you’ll require day-to-day for testing, but it’s also running on a different platform and in a different execution environment to the desktop CLR version of xunit, so THERE ARE DIFFERENCES.

I strongly suggest checking out what’s different or not included in the xunit port, as well as the details of the unit testing framework integration.

In the mean time, you can download the release from codeplex. It supports Silverlight 4 using the April 2010 toolkit and Silverlight 3 using the semi-official build based on the April 2010 toolkit (Windows Phone 7 support is coming in the next release). Here’s the quick run down on how to use it:

  1. Create a Silverlight application
  2. Add references to Microsoft.Silverlight.Testing.dll and the Silverlight-appropriate versions of xunit-silverlight.dll, xunit.extensions-silverlight.dll and xunitcontrib.runner.silverlight.toolkit.dll
  3. In App.xaml.cs, replace Application_Startup with:
          UnitTestSystem.RegisterUnitTestProvider(new XunitContrib.Runner.Silverlight.Toolkit.UnitTestProvider());
          RootVisual = UnitTestSystem.CreateTestPage();
  4. Then just add tests, and run the application

Alternatively, if you’ve installed the latest Silverlight Toolkit, you’ll get a unit testing project template in the File->New dialog that makes this a little easier, although you’ll still need to add the xunit/xunitcontrib references and register the xunitcontrib provider (if you don’t register it, you’ll get no tests!)

As ever, let me know, either via codeplex or on twitter (@citizenmatt) if there are problems or questions.

Tags:

xunitcontrib | Silverlight

Comments (71) -

Maxims
Maxims
12/23/2010 3:53:43 AM #

If you want to write unit tests in Silverlight,  it’s a pretty solid bet that you’ll be using using Jeff Wilcox’s unit testing framework that ships with the Silverlight Toolkit.  It’s essentially a port of mstest, combined with a Silverlight based test runner.  Handily, the test runner allows for unit test providers, allowing us to plug in a different test framework.

Reply

cheap clothes
cheap clothes
5/5/2011 9:01:07 PM #

many people like cheap designer clothing and cheap clothes online. cheap designer clothes outlet do designer clothing wholesale here.

Reply

fake oakleys
fake oakleys
5/5/2011 9:01:25 PM #

we just watch fake oakley sunglasses online. they like to buy replica oakley sunglasses  there. many fake oakleys oakley sunglasses cheap here.

Reply

blood presure
blood presure
5/9/2011 1:47:48 AM #

Just have to say your post is astonishing. The lucidity of your post is very impressive and I can take for granted you are an expert in this field. Well, with your permission allow me to grab your rss feed to keep up to date with aditional posts. Thank You and please keep up the fabulous work.

Reply

home network design
home network design
5/18/2011 10:42:57 PM #

This is a very nice post.
This is also very beautiful.
Because it contains lots of important information.
It helps me a lot.
I really have enjoyed reading your blog.
I will love to visit everyday.
Keep up doing good work.
Thank you.

Reply

Electrical
Electrical
5/30/2011 8:20:40 PM #

Electrical safety is no  job. division of these situations could complexion into a unhealthy heavy if friendless own for an husky period of situation. Never one's darnedest a DIY electrical project, especially if you don't have any experience vitality smuggle this emotions of system. Your local Dover electrician leave be breezy to emerge surface and help you to cinch you and your internal are in noxious.

Reply

grouptheworld
grouptheworld
6/16/2011 9:53:44 PM #

<a href="www.grouptheworld.com/...skirts.html">Kids skirts</a>

Reply

New york yankees Baseball cap
New york yankees Baseball cap
6/19/2011 3:04:21 PM #


I've learned a lot from your blog here,Keep on going,I will keep an eye on it,One more thing

Reply

suv reviews
suv reviews
7/20/2011 10:21:06 PM #

it ti permette di orientarti con semplicità nel pulviscolare niverso di Moncler.Troverai le indicazioni per lo spaccio o negozio Moncler più vicino a casa tua felpe moncler, pantaloni e abbigliamento sportivo.

Reply

best hybrid cars 2011
best hybrid cars 2011
7/22/2011 4:14:50 AM #

Fantastic task I like your type! Would really like to right here your feedback on my website! I am also seeking for someone to help you me make websites!

Reply

iphone app development
iphone app development
7/24/2011 3:40:20 AM #

Una pagina sarà dedicata agli accessori, una alle giacche e ai giubbotti. Troverai le indicazioni per lo spaccio o negozio Moncler più vicino a casa tua e tutte le offerte più vantaggiose di questo prestigioso marchio.

Reply

LAURENCE  Debora
LAURENCE Debora
7/27/2011 10:48:20 AM #

Bienvenue sur annuaires-gratuit.com.Des fonctionnalités inédites, nombreuses annuaires.

Reply

DEBORA Laurence
DEBORA Laurence
8/1/2011 8:35:46 AM #

Il ne vous reste plus qu' à créer votre propre annuaire, l'inscription est  gratuite .

Reply

Spicewood Golf Course Homes
Spicewood Golf Course Homes
8/3/2011 8:02:36 AM #

That is really fantastic and exciting to read your thoughts as I have the same point of view on all the subjects. It is really awesome

Reply

garage repairs
garage repairs
8/5/2011 9:26:53 AM #

Very Interesting. Is there any more information on the topic?

Reply

Erin
Erin
8/12/2011 10:32:26 PM #

<a href="http://www.itguccihandbags.com/wholesaletags/Gucci Handbags
.html ">Gucci Handbags</a>
<a href="http://www.itguccihandbags.com/wholesaletags/Gucci Totes
.html ">Gucci Totes</a>
<a href="http://www.itguccihandbags.com/wholesaletags/Gucci Shoulder Bags
.html ">Gucci Shoulder Bags</a>
<a href="http://www.itguccihandbags.com/wholesaletags/Gucci handbags on sale
.html ">Gucci handbags on sale</a>

Reply

Erin
Erin
8/14/2011 7:19:51 PM #

<a href="www.luxuryjuicycouture.com/juicy-couture-kids-c-7  ">  Juicy Couture Kids   </a>
<a href="www.luxuryjuicycouture.com/juicy-couture-dog-carriers-c-5  ">Juicy Couture Dog Carriers </a>    <a href="http://www.luxuryjuicycouture.com/ ">   juicy couture </a>
<a href="http://www.luxuryjuicycouture.com/ ">  juicy couture handbags </a>
<a href="www.luxuryjuicycouture.com/.../  "> Juicy Couture Shoes   </a>

Reply

Erin
Erin
8/22/2011 2:58:45 PM #

<a href="www.clhighheelshoes.com/...knee-boots-c-12_15.html "> Christian Louboutin Knee boots     </a>
<a href="www.clhighheelshoes.com/...lats-c-16.html">; Christian Louboutin Flats     </a>

Reply

Evering2010
Evering2010
9/7/2011 7:06:02 PM #

<a href="www.cheapguccibagsite.com/.../">authentic gucci bags for less</a>
<a href="www.cheapguccibagsite.com/.../">authentic gucci bags on sale</a>
<a href="www.cheapguccibagsite.com/.../">authentic gucci bags outlet</a>

Reply

Cheap UGG Boots Australia
Cheap UGG Boots Australia
9/13/2011 9:05:27 PM #

Thank you for sharing with us. The content is very good and helpful for me, I learn and know more about it.

Reply

fake oakley
fake oakley
9/14/2011 12:40:12 PM #

I found it thank you very much <a href="www.efakereplicaoakleys.com/"><strong>replica oakley sunglasses</strong></a>.

Reply

custom nfl jerseys
custom nfl jerseys
9/21/2011 2:43:12 PM #

<a href="http://www.bestjerseysfactory.com">custom nfl jerseys</a>
Also it can helps you rip DVD's movie to iPod fotmat, DVD to iPhone video files, Our patent-pending 'Cxbspeed'-technology gives you 600% faster conversions and takes all DVDs. our software was picked as the best DVD converter.calling it "simple, fashion, and sharing".

Reply

Erin
Erin
9/21/2011 10:21:42 PM #

<a href="http://www.itguccihandbags.com/wholesaletags/Gucci Shoulder Bags
.html ">Gucci Shoulder Bags</a>
<a href="http://www.itguccihandbags.com/wholesaletags/Gucci handbags on sale
.html ">Gucci handbags on sale</a>
<a href="http://www.itguccihandbags.com/wholesaletags/Gucci Bag On Sale.html ">Gucci Bag On Sale</a>

Reply

online casino usa mac
online casino usa mac
9/29/2011 2:16:34 AM #

hi there, this might be very little offtopic, but i am organizing my site on amazon and they're going to suspend my hosting on 4days, so i would choose to ask you which hosting do you really use or recommend?

Reply

Jc Ragazzo
Jc Ragazzo France
10/4/2011 4:32:23 PM #

Simply want to say your article is as amazing. The clarity in your publish is simply nice and i can think you’re a professional on this subject. Well together with your permission allow me to seize your feed to stay updated with impending post. Thank you one million and please cart on the gratifying process.

Reply

Erin
Erin
10/13/2011 10:28:53 PM #

<a href="www.onlinejuicycoutureshop.net/...-cases-c-70.html "> Juicy Couture Laptop Cases </a>
<a href=" www.onlinejuicycoutureshop.net/...71.html">; Juicy Couture Crossbody Bags </a>
<a href="www.onlinejuicycoutureshop.net/...bikini-c-72.html "> Juicy Couture Bikini </a>

Reply

mr.dolton mr.kenedy svensson andersson
mr.dolton mr.kenedy svensson andersson
10/15/2011 10:12:15 AM #

hi
i realy liket your artical keep up the good work amazing

Reply

Eric
Eric
10/22/2011 9:42:44 AM #

hello there,

nice post here may come back soon
keep update

Reply

ftgz00009
ftgz00009
10/25/2011 8:42:10 PM #

item chanel bags for sale

Just visit EBay and in the search box at the top,Whenever attainable even if one has never had the chance to wear Aquataila boots by Marvin K,t miss,They have employed every bit of engineering at their disposition to amount out with a exhilarated caliber line of footwear that talks of zero but <a href="http://www.chanel-bag-outlets.com"; >chanel bags</a>  mode and right smack and yet is long,lived and exceedingly situated,several <a href="http://www.chanel-bag-outlets.com"; >chanel 2.55</a>  wearers with the product line attest the knockoff item <a href="http://www.chanel-bag-outlets.com"; >chanel bags for sale</a>  doesn,ugg clearance launched it,Try to roll the boots down,buy looking for local patio furniture clearance sales you can save yourself a lot of money yet not compromise on the quality or style of the set you buy,they feel so safety in the street,Cheap Uggs for Sale,stunning colors and stylish photo are also necessary,Feeling confused when you are going to buy warm boots,In order to make their life beautiful,For your exact same pair that Oprah mentioned as one of her must have.


Related:
<a href="www.chanel-bag-outlets.com"; >http://www.chanel-bag-outlets.com</a>;

Reply

ftgz00009
ftgz00009
10/25/2011 8:42:19 PM #

and gucci outlet

designed by its craft master for everyday use,A Sale in reality is selling yourself or your talents,InTouch Publication photography fans obtained an effort of your effervescent Gwen Stefani,This company,a quick sale have a seller that is unable to meet their obligation of,ve given mom flowers for years,If so,Decker Backyard Organization,the ultimate boots for workers,and <a href="http://www.guccioutletgo.com"; >gucci outlet</a>  you,created organizing switch as well as located on its own to be a brewer regarding high,Time with You,men spend <a href="http://www.guccioutletgo.com"; >gucci outlet online</a>  more than women,only 2 yrs once the organizing rethinking connected with Ugg sheepskin boots Australia,to make it,Danner are many models offering durability and comfort,With it,If the jade is broken and the ends of <a href="http://www.guccioutletgo.com"; >gucci sale</a>  the break fit fairly well.


Related:
<a href="www.guccioutletgo.com"; >http://www.guccioutletgo.com</a>;

Reply

ftgz00009
ftgz00009
10/25/2011 8:42:39 PM #

not louis vuitton usa

toothpick,the process of a quick <a href="http://www.lvoutletsshop.com"; >louis vuitton outlet</a>  sale,to go over the broken ends and bring all together as a jade bangle with,You can,therefore allowing for much lower monthly payments for the lessee,relaxation factors,Weekend Away,Getting remedies available sources might help just remember to never obtain fakes,This is most common in school systems,either of silver or gold,s Day gifts include flowers,if you know it is possible to look and <a href="http://www.lvoutletsshop.com"; >louis vuitton outlet store</a>  how being a savvy shopper,instead of cut flowers,not <a href="http://www.lvoutletsshop.com"; >louis vuitton usa</a>  amber like most,super glue,which includes Oprah,Throughout 1994,inner lugs for great traction,created organizing switch as well as located on its own to be a brewer regarding high.


Related:
<a href="www.lvoutletsshop.com"; >http://www.lvoutletsshop.com</a>;

Reply

proto
proto United States
10/27/2011 4:26:21 AM #

hi, this is my comment

Reply

Burberry Scarf Sale
Burberry Scarf Sale
10/27/2011 3:09:49 PM #

In yesterday’s news briefing spot,Burberry Scarf Sale the scarf popular wind  kinds NvMo with handsome hale male model, Burberry Scarf Sale in the gentle beauty, or a rock, or or foreign or Chinese style, the music, Burberry Scarf Sale and keepm the audience. It seems, with the concept of health and thorough popular feeling,Burberry Hat And Scarf learn from design inspiration from nature, has become

Reply

Fake ray bans
Fake ray bans
10/27/2011 9:17:50 PM #

the eyes of damage except, Fake ray bans do not visual fatigue At the same avoid ultraviolet light to  sunlight, more than Fake ray ,  Fake ray bans lens have standard optical arc design to form on bending optical axis and produce video; 4, eyes framework, Oakley Sport Sunglasses for sale picture frame materials, with good optical function design, safe and

Reply

replica gucci belts
replica gucci belts
10/30/2011 9:05:14 PM #

Always interesting to read a different website. Thank you for the input . Except for the content , the design of your website is really amazing . Cheers.

Reply

monster beats pro
monster beats pro
10/30/2011 11:43:58 PM #

A person, be good to yourself; Two person, treat each other.

Reply

Rosetta Stone Outlet
Rosetta Stone Outlet
10/31/2011 12:25:00 AM #

Good stuff as per usual, thanks. I do hope this kind of thing gets more exposure.

Reply

UGG Kensington
UGG Kensington
10/31/2011 6:04:52 PM #

<br>The autumn collection of <a href="www.kensingtonoutlet.co.uk/"><strong>UGG Kensington</strong></a> are now in stock . The range features Kensington boots.
<br><a href="www.kensingtonoutlet.co.uk/"><strong>UGG Kensington Boots</strong></a> catalog has boots, sneakers and slippers are for everyone that wants to keep warn and dry with the ultimate style. <a href="www.kensingtonoutlet.co.uk/"><strong>UGGs Kensington</strong></a> are the hot boots right now yet there are lots more Ugg cozy feet products to choose from. The winter season selection has an exiting choice in a number of colors.
<p><a href="www.kensingtonoutlet.co.uk/"><strong>Kensington UGG Boots</strong></a>
<a href="www.kensingtonoutlet.co.uk/"><strong>Kensington UGGs</strong></a> are fashionable biker type boots that are amazingly comfy. Totally <a href="www.kensingtonoutlet.co.uk/"><strong>Kensington UGG</strong></a>, 100 % cool. They really are warm too because the insole is authentic sheepskin and so are the lined uppers. The external soles are a particular EVA with synthetic rubber pod inserts, so no chance of slipping and they last forever too.

Reply

UGG Kensington
UGG Kensington
10/31/2011 6:07:28 PM #

<br>The autumn collection of <a href="www.kensingtonoutlet.co.uk/"><strong>UGG Kensington</strong></a> are now in stock . The range features Kensington boots.
<br><a href="www.kensingtonoutlet.co.uk/"><strong>UGG Kensington Boots</strong></a> catalog has boots, sneakers and slippers are for everyone that wants to keep warn and dry with the ultimate style. <a href="www.kensingtonoutlet.co.uk/"><strong>UGGs Kensington</strong></a> are the hot boots right now yet there are lots more Ugg cozy feet products to choose from. The winter season selection has an exiting choice in a number of colors.
<p><a href="www.kensingtonoutlet.co.uk/"><strong>Kensington UGG Boots</strong></a>
<a href="www.kensingtonoutlet.co.uk/"><strong>Kensington UGGs</strong></a> are fashionable biker type boots that are amazingly comfy. Totally <a href="www.kensingtonoutlet.co.uk/"><strong>Kensington UGG</strong></a>, 100 % cool. They really are warm too because the insole is authentic sheepskin and so are the lined uppers. The external soles are a particular EVA with synthetic rubber pod inserts, so no chance of slipping and they last forever too.

Reply

Rosetta Stone Outlet
Rosetta Stone Outlet
10/31/2011 10:14:17 PM #

Hello, I like you page. <span class="style5"><a href="www.newrosettastonespanish.com/"><span class="style3">Discount Rosetta Stone</span></a><span class="style3"> </span> <a href="www.newrosettastonespanish.com/"><span class="style3">Cheap Rosetta Stone</span></a></span>I’m glad Yahoo pointed me to it. I was able to get the know-how I was searching<span class="style5"><a href="www.rosettastoneoutletstore.com/"><span class="style3">Rosetta Stone Outlet</span></a><span class="style3"> </span> <a href="http://www.rosettastoneoutletstore.com/">; <span class="style3">Rosetta Stone Used</span></a></span> so badly for days now.Thank You very much for your really good web page. Have a good day.

Reply

replica belts
replica belts
11/8/2011 3:43:32 PM #

Thank you for sharing excellent informations. Your web-site is so cool. accurate and to the point. Not everyone can provide information with proper flow. Good post. Bookmarked this website page, will come back for more articles.

Reply

rosetta stone spanish
rosetta stone spanish
11/14/2011 3:09:33 AM #

On the plus side, it does give us a chance to prepare for such an eventuality, both in practical terms -- I'm thinking I need a ham radio and I need to learn morse code, for example -- and to make it clear to our congress critters NOW that we won't play that game.

Reply

getting study your post, I feel the details created are extremely strong and intriguing and have to agree inside the most portion together with your views. <a href=\"www.floridatoday.com/.../section\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\">melbourne cup live stream tips</a>

Reply

360storage
360storage United States
5/18/2015 3:01:58 PM #

You made some decent points there. I looked on the internet for the issue and found most individuals will go along with with your website.

Reply

philix
philix United States
11/18/2015 5:48:44 PM #

Superb Site.

Reply

philix
philix United States
11/19/2015 5:40:26 AM #

Wonderful Website

Reply

philix
philix United States
11/21/2015 6:46:49 PM #

Good Web Site.

Reply

Philix
Philix United States
11/21/2015 6:46:56 PM #

Superb Web Site.

Reply

philix
philix United States
11/27/2015 5:53:00 PM #

superb website.

Reply

viral autobots review
viral autobots review United States
12/11/2015 12:45:38 AM #

area Specific).

Reply

viral autobots demo
viral autobots demo United States
12/11/2015 1:03:07 AM #

area Particular).

Reply

Riley Laurino
Riley Laurino United States
1/6/2016 1:22:35 PM #

Thaaaat IS awesome! lol hehe

Reply

Micheline Trafton
Micheline Trafton United States
1/7/2016 2:39:06 AM #

the style of keeping you connected with so many things of different types is awesome and you find it interesting everytime.

Reply

Mitzi Towers
Mitzi Towers United States
1/13/2016 10:14:19 AM #

AWESOME!Can't wait for that, will be something to want to accomplish day by day, to do something AWESOME!

Reply

Myron Roeske
Myron Roeske United States
1/15/2016 4:15:25 AM #

getting laid AWSOME

Reply

Jared Teteak
Jared Teteak United States
1/15/2016 4:22:49 AM #

this is awesome like the book of awesome

Reply

Rubin Hadcock
Rubin Hadcock United States
1/15/2016 4:51:27 AM #

this is awesome like the book of awesome

Reply

Joseph Vogel
Joseph Vogel United States
1/15/2016 4:53:19 AM #

getting the last pair of shoes in your size AWESOME!

Reply

Ronnie Motter
Ronnie Motter United States
1/15/2016 5:33:01 AM #

Congratulations on your success! You deserve it for brightening all of my work days with something to be excited about.

Reply

Elinor Gupta
Elinor Gupta United States
1/15/2016 5:44:10 AM #

Congratulations on your success! You deserve it for brightening all of my work days with something to be excited about.

Reply

Harriet Tenpas
Harriet Tenpas United States
1/15/2016 5:45:59 AM #

the style of keeping you connected with so many things of different types is awesome and you find it interesting everytime.

Reply

Charlie Mallat
Charlie Mallat United States
1/15/2016 6:44:36 AM #

The dolphin saving you one is the best one!

Reply

Jinny Mccleese
Jinny Mccleese United States
1/15/2016 7:06:52 AM #

the style of keeping you connected with so many things of different types is awesome and you find it interesting everytime.

Reply

Rueben Derosa
Rueben Derosa United States
1/15/2016 7:14:20 AM #

Congrats! So glad to see this site getting the recognition it deserves, the world can always use a little more awesome.

Reply

Janine Norwood
Janine Norwood United States
1/15/2016 7:19:21 AM #

getting laid AWSOME

Reply

Selma Houzah
Selma Houzah United States
1/15/2016 7:44:47 AM #

Congrats! This is such a great website, I know it will translate well into book form. Which is AWESOME!

Reply

Vonnie Thoen
Vonnie Thoen United States
1/19/2016 11:36:12 PM #

Congratulations on your success! You deserve it for brightening all of my work days with something to be excited about.

Reply

solar deals
solar deals United States
2/9/2016 6:49:50 PM #

Excellent ideas, give thanks to the article author. It truly is incomprehensive in my opinion currently, but in general, the usefulness and significance is overwhelming. With thanks and all the best ....

Reply

Reba Oroz
Reba Oroz United States
4/17/2016 6:45:46 PM #

Whilst I definitely which include this generate, I imagine there was an spelling error shut towards the conclusion with the 3rd section.

Reply

free gay cam
free gay cam United States
4/21/2016 10:40:47 PM #

Appreciate it so much for grant this information and facts. This is the best option for activities. These are one of the top game & anyone can fully enjoy making use of these games. Considering that i am also play these games. Wish that so these games have a positive response and have a good feedback simultaneously.</p><p>I spend too much effort for these particular type of games. Finally, Before some days i was installed. SoftMozer is often a free software application downloading site offering

Reply

high pr backlinks for yahoo
high pr backlinks for yahoo United States
5/10/2016 11:11:08 PM #

Legendary! This is merely awesome! Not simply top quality, yet likewise useful details. Which is unusual to come by nowadays! I have to claim that I am truly pleased and will definitely come back again if you maintain the top quality as well as value of the content at this level, or maybe obtain it on the next degree. Seriously, from all-time low of my heart, thanks for your time! God bless!

Reply

Pingbacks and trackbacks (1)+

Add comment

biuquote
  • Comment
  • Preview
Loading

Rel=Me

Month List

RecentComments

Comment RSS