Minimal StoryQ demo

// StoryQ demo

This is a basic demo of using StoryQ.
You need to implement the void methods with wrappers around the system functionality under test.

Note this uses the Given/When/Then pattern as opposed to the normal NUnit Assemble, Action, Assert.

using System;
using NUnit.Framework;

using StoryQ;

namespace Experiments
{

[TestFixture]
public class FirstTest
{

[Test]
public void SunshinePath()
{
new Story(“User Management”).InOrderTo(“Add User”)
.AsA(“Admin”).IWant(“To Add a User to the system”)
.WithScenario(“HappyPath”)
.Given(IHaveEnteredUserName)
.When(IPressSave)
.Then(UserIsAdded)
.And(IAmReturnedToTheMainWindow)
.WithScenario(“UserExists”)
.Given(IHaveEnteredUserName)
.When(IPressSave)
.And(UserAlreadyExists)
.Then(IAmShownErrorMessage)
.ExecuteWithReport();
}

private void IHaveEnteredUserName()
{
throw new NotImplementedException();
}

private void IPressSave()
{
throw new NotImplementedException();
}

private void UserIsAdded()
{
throw new NotImplementedException();
}

private void IAmReturnedToTheMainWindow()
{
throw new NotImplementedException();
}

private void UserAlreadyExists()
{
throw new NotImplementedException();
}

private void IAmShownErrorMessage()

{

throw new NotImplementedException();

}

}

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s