From WPF functional Unit Tests to Specifications using MSpec and White

I am in the train back home and wanted to try out quickly to migrate our WPF functional tests written has Unit Tests to BDD Specifications.

Here is the code I started from, pure Unit Test using NUnit and White

public void Opening_Valid_VersionZip()

    Assert.That(MainWindow.Title.Equals("Product.zip - Innoveo Skye® Editor"));
    Assert.That(ProductTree.Nodes.Count >= 1);

Now the same functional test written as a BDD specification using MSpec

public class when_user_open_valid_versionzip : MainWindowViewSpecs
    Establish context = () => {};

    Because of = () => OpenAndWait("Product.zip");

    It should_display_mainwindow_title_correctly = () =>
        MainWindow.Title.ShouldEqual("Product.zip - Innoveo Skye® Editor");

    It should_display_status_correctly = () =>

    It should_display_the_product_tree = () =>

    It should_hide_the_splashscreen = () =>

    It should_enable_save_button = () =>

    It should_enable_activate_button = () =>

And the output in ReSharper MSpec plugin


Which one do you prefer? I personally have made my choice.

About Laurent

Laurent Kempé

Laurent Kempé is the editor, founder, and primary contributor of Tech Head Brothers, a French portal about Microsoft .NET technologies.

He is currently employed by Innoveo Solutions since 10/2007 as a Senior Solution Architect, certified Scrum Master and Founding Member.

Founder, owner and Managing Partner of Jobping, which provides a unique and efficient platform for connecting Microsoft skilled job seekers with employers using Microsoft technologies.

Laurent was awarded Most Valuable Professional (MVP) by Microsoft from April 2002 to April 2012.

JetBrains Academy Member
Certified ScrumMaster
My status



This is a Flickr badge showing public photos and videos from Laurent Kempé. Make your own badge here.

Month List

Page List