public void RequestToken_Should_Return_A_Token_When_The_User_Is_Valid() { var mockTokenService = GetMockTokenService(); var mockUserManagementService = GetMockIUserManagementService(true); var controller = new BaseAuthenticationController(mockTokenService.Object, mockUserManagementService.Object); var result = controller.RequestToken(new BaseApi.Auth.Models.TokenRequest()); var okResult = Assert.IsType <OkObjectResult>(result); Assert.Equal("thetoken", okResult.Value); }
public void RequestToken_Should_Return_Invalid_User_When_The_User_Is_Not_Valid() { var mockTokenService = GetMockTokenService(); var mockUserManagementService = GetMockIUserManagementService(false); var controller = new BaseAuthenticationController(mockTokenService.Object, mockUserManagementService.Object); var result = controller.RequestToken(new BaseApi.Auth.Models.TokenRequest()); var badRequestResult = Assert.IsType <BadRequestObjectResult>(result); Assert.Equal("Invalid User", badRequestResult.Value); }