public void WhenDirectedToAuthController_ThenReturnsSignInView() { IUserServices userServices = new Mock<IUserServices>().Object; IOpenIdRelyingParty relyingParty = new Mock<IOpenIdRelyingParty>().Object; IFormsAuthentication formsAuth = new Mock<IFormsAuthentication>().Object; var authController = new AuthController(relyingParty, formsAuth, userServices); ActionResult responseAction = authController.SignIn(); Assert.IsType(typeof (ViewResult), responseAction); }
public void WhenUserSignsOut_ThenSignThemOut() { var formsMock = new Mock<IFormsAuthentication>(); var userServicesMock = new Mock<IUserServices>(); var authController = new AuthController(OpenIdRelyingPartyBuilder.DefaultParty().Object, formsMock.Object, userServicesMock.Object); ActionResult response = authController.SignOut(); formsMock.Verify(x => x.Signout(), Times.Once()); Assert.IsType<RedirectToRouteResult>(response); }