private ResponseDto <LoginDto> FailedAttempt(FailedAttempts attempts, string error) { using (var gateway = new AuthenticationGateway()) { gateway.UpdateFailedAttempt(attempts); } return(Error(error)); }
private ResponseDto <LoginDto> SuccessfulAttempt(FailedAttempts attempts, LoginDto dto) { using (var gateway = new AuthenticationGateway()) { gateway.UpdateFailedAttempt(attempts); } return(new ResponseDto <LoginDto>() { Data = dto }); }
public void Should_ReturnTrue_When_UserIdIsNull_InFailedAttempt() { // Arrange var gateway = new AuthenticationGateway(); var incomingFailedAttempt = new FailedAttempts() { LastAttemptTime = DateTime.UtcNow }; // Act var result = gateway.UpdateFailedAttempt(incomingFailedAttempt); // Assert result.Data.Should().BeFalse(); result.Error.Should().NotBeNullOrEmpty(); }