public void JackCannotAccessIndex() { // Arrange var controller = new JillController(); var principal = new FakePrincipal("Jack"); // Act var result = controller.Index(principal); // Assert Assert.IsInstanceOfType(result, typeof(HttpUnauthorizedResult)); }
public void JillCanAccessIndex() { // Arrange var controller = new JillController(); var principal = new FakePrincipal("Jill"); // Act var result = controller.Index(principal); // Assert Assert.IsInstanceOfType(result, typeof(ViewResult)); }