Skip to content

Instantly share code, notes, and snippets.

@DavidSSL
Created September 21, 2012 19:52
Show Gist options
  • Save DavidSSL/3763526 to your computer and use it in GitHub Desktop.
Save DavidSSL/3763526 to your computer and use it in GitHub Desktop.
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