Created
October 25, 2010 18:44
-
-
Save alexyork/645466 to your computer and use it in GitHub Desktop.
ASP.NET MVC Blog Tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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