public void CorrectLogInReturnsTrue() { DummyMockedLoginRepository _dummyMockedLoginRepository = new DummyMockedLoginRepository(); ILogInService _logInService = new LogInService(_dummyMockedLoginRepository._logInRepository); _logInService.SaveDataFromView("Wolf4", "1234"); Assert.IsTrue(_logInService.CorrectLogin()); }
public void SaveDataFromViewisSavingDataInModel() { LogInService _logInService = new LogInService(); _logInService.SaveDataFromView("Wolf", "1234"); Assert.AreEqual(_logInService.GetUser().userName, "Wolf"); Assert.AreEqual(_logInService.GetUser().password, "1234"); }
public void GetPasswordFromDBIsGettingPassword() { DummyMockedLoginRepository _dummyMockedLoginRepository = new DummyMockedLoginRepository(); ILogInService _logInService = new LogInService(_dummyMockedLoginRepository._logInRepository); _logInService.SaveDataFromView("Wolf", "1234"); Assert.AreEqual(_logInService.GetIDLoggedUser(), 1); }
public void CorrectLogInThrowsException() { DummyMockedLoginRepository _dummyMockedLoginRepository = new DummyMockedLoginRepository(); ILogInService _logInService = new LogInService(_dummyMockedLoginRepository._logInRepository); _logInService.SaveDataFromView("Wolf4", "123"); Assert.Throws <LogInException>(() => _logInService.CorrectLogin()); }