The Artima Developer Community
Sponsored Link

Agile Buzz Forum
MBUnit for .NET testing

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jared Richardson

Posts: 1031
Nickname: jaredr
Registered: Jun, 2005

Jared Richardson is an author, speaker, and consultant who enjoys working with Ruby and Rails.
MBUnit for .NET testing Posted: Aug 11, 2005 5:36 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by Jared Richardson.
Original Post: MBUnit for .NET testing
Feed Title: Jared's Weblog
Feed URL: http://www.jaredrichardson.net/blog/index.rss
Feed Description: Jared's weblog. The web site was created after the launch of the book "Ship It!" and discusses issues from Continuous Integration to web hosting providers.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by Jared Richardson
Latest Posts From Jared's Weblog

Advertisement

A co-worker of mine (Susan Bartholow) mentioned a neat feature in MBUnit today and I thought it was share-worthy. :)

First, what is MBUnit? MBUnit is a .NET testing framework. You can use it for testing any of the .NET family of languages. C#, VB, etc. Here's a short tutorial.

Remember, a testing framework with "unit" in the name isn't just useful for unit testing! ;) The various XUnit frameworks are great for functional and integration tests as well.

Second, Susan's tip about the decorator. (A decorator is a feature added to the test framework.) She found a decorator in MBUnit called ThreadedRepeat.

Here's a short description of ThreadedRepeat from the Peli's Farm blog

In MbUnit, other decorators are available. Here I describe two of those:
RepeatAttribute and ThreadedRepeatAttribute. RepeatAttribute will make the
execution of the test repeated the desired number of times in the same thread
while ThreadedRepeatAttribute will launch simultaneously a desired number of
threads that will execute the method. RepeatAttribute create a sequence of
execution, ThreadedRepeatAttribute create a parallel execution.

    [Test]
    [Repeat(10)] // this will make the RepeatedTest executed 10 times
    public void RepeatedTest()
    { ... }

    [Test]
    [ThreadedRepeat(10)] // this will make the RepeatedTest executed in 10 concurent threads
    public void AmIThreadSake()
    { ... }
  
This is a quick decorator that can help get you started with some basic threaded testing. You can simulate multiple users or a heavier load. It's a great way to leverage your existing test suites. Talk about code re-use! :)

-Enjoy!

Jared

Read: MBUnit for .NET testing

Topic: More iTunes Annoyance Previous Topic   Next Topic Topic: I messed up and I apologize

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use