コード例 #1
0
        public void CorrectLogInReturnsTrue()
        {
            DummyMockedLoginRepository _dummyMockedLoginRepository = new DummyMockedLoginRepository();
            ILogInService _logInService = new LogInService(_dummyMockedLoginRepository._logInRepository);

            _logInService.SaveDataFromView("Wolf4", "1234");
            Assert.IsTrue(_logInService.CorrectLogin());
        }
コード例 #2
0
        public void SaveDataFromViewisSavingDataInModel()
        {
            LogInService _logInService = new LogInService();

            _logInService.SaveDataFromView("Wolf", "1234");
            Assert.AreEqual(_logInService.GetUser().userName, "Wolf");
            Assert.AreEqual(_logInService.GetUser().password, "1234");
        }
コード例 #3
0
        public void GetPasswordFromDBIsGettingPassword()
        {
            DummyMockedLoginRepository _dummyMockedLoginRepository = new DummyMockedLoginRepository();
            ILogInService _logInService = new LogInService(_dummyMockedLoginRepository._logInRepository);

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

            _logInService.SaveDataFromView("Wolf4", "123");
            Assert.Throws <LogInException>(() => _logInService.CorrectLogin());
        }