Created
September 21, 2012 19:52
-
-
Save DavidSSL/3763526 to your computer and use it in GitHub Desktop.
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.Web.Mvc; | |
using FakeItEasy; | |
using Machine.Specifications; | |
using Machine.Specifications.Mvc; | |
using MSpecMvcApplication.Controllers; | |
namespace MSpecMvcApplication.Tests.Controllers | |
{ | |
[Subject(typeof(HomeController))] | |
public class when_the_home_controller_is_told_to_display_the_default_view | |
{ | |
//static string key; | |
//static string message; | |
static ActionResult result; | |
static HomeController home_controller; | |
Establish context = () => | |
{ | |
//key = "Message"; | |
//message = "Welcome to ASP.NET MVC!"; | |
home_controller = new HomeController | |
{ | |
ControllerContext = A.Fake<ControllerContext>() | |
}; | |
}; | |
Because of = () => | |
{ | |
result = home_controller.Index(); | |
}; | |
It should_return_the_home_view = () => | |
result.ShouldBeAView(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment