Example #1
0
        public void CreateNewPassThrowsException()
        {
            DummyMockedLoginRepository _dummyMockedLoginRepository = new DummyMockedLoginRepository();
            ILogInService _logInService = new LogInService(_dummyMockedLoginRepository._logInRepository);

            Assert.Throws <LogInException>(() => _logInService.CreateNewPass("Wolf", "lucho22v.bg"));
        }
Example #2
0
        public void GePositionReturnsPosition()
        {
            DummyMockedLoginRepository _dummyMockedLoginRepository = new DummyMockedLoginRepository();
            ILogInService _logInService = new LogInService(_dummyMockedLoginRepository._logInRepository);

            Assert.AreEqual("Admin", _logInService.GetPosition());
        }
Example #3
0
        public void CorrectLogInReturnsTrue()
        {
            DummyMockedLoginRepository _dummyMockedLoginRepository = new DummyMockedLoginRepository();
            ILogInService _logInService = new LogInService(_dummyMockedLoginRepository._logInRepository);

            _logInService.SaveDataFromView("Wolf4", "1234");
            Assert.IsTrue(_logInService.CorrectLogin());
        }
Example #4
0
        public void GetPasswordFromDBIsGettingPassword()
        {
            DummyMockedLoginRepository _dummyMockedLoginRepository = new DummyMockedLoginRepository();
            ILogInService _logInService = new LogInService(_dummyMockedLoginRepository._logInRepository);

            _logInService.SaveDataFromView("Wolf", "1234");
            Assert.AreEqual(_logInService.GetIDLoggedUser(), 1);
        }
Example #5
0
        public void CorrectLogInThrowsException()
        {
            DummyMockedLoginRepository _dummyMockedLoginRepository = new DummyMockedLoginRepository();
            ILogInService _logInService = new LogInService(_dummyMockedLoginRepository._logInRepository);

            _logInService.SaveDataFromView("Wolf4", "123");
            Assert.Throws <LogInException>(() => _logInService.CorrectLogin());
        }
Example #6
0
        public void CreateNewPassCreates()
        {
            DummyMockedLoginRepository _dummyMockedLoginRepository = new DummyMockedLoginRepository();
            ILogInService _logInService = new LogInService(_dummyMockedLoginRepository._logInRepository);

            _logInService.CreateNewPass("Wolf", "*****@*****.**");

            Assert.AreNotEqual("1234", _dummyMockedLoginRepository._logInRepository.GetPasswordForUser("Wolf"));
        }