public void LoginSuccessfulTest_ChecksIfTheSecurityKeysAreProperlyReturnedWhileLoggingIn_VerifiesTheReturnedKeysToConfirm()
        {
            IUserRepository userRepository = new MockUserRepository();
            IIdentityAccessPersistenceRepository persistRepository = new MockPersistenceRepository(false);
            ISecurityKeysApplicationService      securityKeysApplicationService = new SecurityKeysApplicationService(new SecurityKeysGenerationService(),
                                                                                                                     persistRepository, null, null);
            IPasswordEncryptionService passwordEncryptionService   = new PasswordEncryptionService();
            IMfaAuthorizationService   mockMfaAuthorizationService = new MockMfaAuthorizationService();
            ILoginApplicationService   loginApplicationService     = new LoginApplicationService(userRepository, passwordEncryptionService,
                                                                                                 securityKeysApplicationService, new MockPersistenceRepository(false), mockMfaAuthorizationService);

            string enteredPassword = "******";
            User   user            = new User("*****@*****.**", "brucewayne", passwordEncryptionService.EncryptPassword(enteredPassword),
                                              "Ninja County", TimeZone.CurrentTimeZone, "", "");

            user.AutoLogout          = new TimeSpan(0, 0, 0, 60);
            user.IsActivationKeyUsed = new IsActivationKeyUsed(true);
            // Add this user to the MockUserRepository
            (userRepository as MockUserRepository).AddUser(user);
            UserValidationEssentials userValidationEssentials = loginApplicationService.Login(
                new LoginCommand("brucewayne", enteredPassword));

            Assert.IsNotNull(userValidationEssentials);
            Assert.IsNotNull(userValidationEssentials.ApiKey);
            Assert.IsNotNull(userValidationEssentials.SecretKey);
            Assert.AreEqual(userValidationEssentials.SessionLogoutTime, user.AutoLogout);
        }
        public void LoginFailDueToBlankPasswordTest_MakesSureLoginFailsInCaseOfBlankPassword_VerifiesTheReturnedNullResultToConfirm()
        {
            IUserRepository userRepository = new MockUserRepository();
            IIdentityAccessPersistenceRepository persistRepository = new MockPersistenceRepository(false);
            ISecurityKeysApplicationService      securityKeysApplicationService = new SecurityKeysApplicationService(new SecurityKeysGenerationService(),
                                                                                                                     persistRepository, null, null);
            IPasswordEncryptionService passwordEncryptionService   = new PasswordEncryptionService();
            IMfaAuthorizationService   mockMfaAuthorizationService = new MockMfaAuthorizationService();
            ILoginApplicationService   loginApplicationService     = new LoginApplicationService(userRepository, passwordEncryptionService,
                                                                                                 securityKeysApplicationService, new MockPersistenceRepository(false), mockMfaAuthorizationService);
            string enteredPassword = "******";
            User   user            = new User("*****@*****.**", "brucewayne", passwordEncryptionService.EncryptPassword(enteredPassword),
                                              "Ninja County", TimeZone.CurrentTimeZone, "", "");

            user.AutoLogout = new TimeSpan(0, 0, 0, 60);
            // Add this user to the MockUserRepository
            (userRepository as MockUserRepository).AddUser(user);

            loginApplicationService.Login(new LoginCommand("brucewayne", ""));
        }