Skip to content

Instantly share code, notes, and snippets.

@rexcfnghk
Created July 1, 2016 03:04
Show Gist options
  • Select an option

  • Save rexcfnghk/c3aba0b7e99b4f37c5ad4cc9f3fff0c2 to your computer and use it in GitHub Desktop.

Select an option

Save rexcfnghk/c3aba0b7e99b4f37c5ad4cc9f3fff0c2 to your computer and use it in GitHub Desktop.
public class HomeController : BaseController
{
public HomeController(UserProfile userProfile) : base(userProfile)
{
}
public ActionResult Index()
{
return View();
}
}
public class HomeControllerTests
{
[Fact]
public void Index_ReturnsNonNullView()
{
// Arrange
var fakeUserProfile = new UserProfile();
var controller = new HomeController(fakeUserProfile);
// Act
var result = (ViewResult)controller.Index();
// Assert
Assert.NotNull(result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment