Skip to content

Instantly share code, notes, and snippets.

@alexyork
Created October 25, 2010 18:44
Show Gist options
  • Save alexyork/645466 to your computer and use it in GitHub Desktop.
Save alexyork/645466 to your computer and use it in GitHub Desktop.
ASP.NET MVC Blog Tests
using System;
using NUnit.Framework;
namespace MvcBlogEngine.Tests.Controllers
{
public partial class WidgetControllerSpec
{
[TestFixture]
public partial class TagCloud : BDDTest
{
[Test]
public void Should_return_the_correct_view()
{
Given(we_have_a_controller);
And(the_blog_post_service_contains_tags);
When(tag_cloud_is_invoked);
Then(the_resulting_view_should_be_the_TagCloud_view);
}
[Test]
public void Should_contain_tags()
{
Given(we_have_a_controller);
And(the_blog_post_service_contains_tags);
When(tag_cloud_is_invoked);
Then(the_resulting_view_should_contain_tags);
}
}
}
public class BDDTest
{
public void Given(Action a) { a.Invoke(); }
public void And(Action a) { a.Invoke(); }
public void When(Action a) { a.Invoke(); }
public void Then(Action a) { a.Invoke(); }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment