public void Create_User_Success() { // Arrange newUser = tu.CreateUserObject(); var expected = newUser; using (_db = tu.CreateDataBaseContext()) { // Act var response = us.CreateUser(_db, newUser); _db.SaveChanges(); //Assert Assert.IsNotNull(response); Assert.AreSame(response, expected); } }
public void CreatePasswordReset_Pass() { //Arrange var newUser = tu.CreateUserObject(); newPasswordReset = tu.CreatePasswordResetObject(newUser); var expected = newPasswordReset; //Act using (_db = tu.CreateDataBaseContext()) { var response = rs.CreatePasswordReset(_db, newPasswordReset); _db.SaveChanges(); //Assert Assert.IsNotNull(response); Assert.AreEqual(response.ResetToken, expected.ResetToken); } }
public void Create_User_Success() { // Arrange User newUser = tu.CreateUserObject(); User expected = newUser; using (var _db = tu.CreateDataBaseContext()) { // Act UserService _us = new UserService(_db); User response = _us.CreateUser(newUser); _db.SaveChanges(); //Assert Assert.IsNotNull(response); Assert.AreSame(response, expected); } }
public void Create_Session_Success() { // Arrange newUser = tu.CreateUserObject(); newSession = tu.CreateSessionObject(newUser); var expected = newSession; using (_db = tu.CreateDataBaseContext()) { // Act var response = ss.CreateSession(_db, newSession); _db.SaveChanges(); //Assert Assert.IsNotNull(response); Assert.AreEqual(response.Id, expected.Id); } }
public void CreateKey_Pass_ReturnKey() { // Arrange newKey = tu.CreateApiKeyObject(); var expected = newKey; using (_db = tu.CreateDataBaseContext()) { IApiKeyService _apiKeyService = new ApiKeyService(_db); IApplicationService _applicationService = new ApplicationService(_db); // Act var response = _apiKeyService.CreateKey(newKey); _db.SaveChanges(); // Assert Assert.IsNotNull(response); Assert.AreEqual(response.Id, expected.Id); _applicationService.DeleteApplication(newKey.ApplicationId); _db.SaveChanges(); } }
public void CreateApplication_Pass_ReturnApp() { // Arrange newApp = tu.CreateApplicationObject(); var expected = newApp; using (var _db = tu.CreateDataBaseContext()) { IApplicationService _applicationService = new ApplicationService(_db);; // Act var response = _applicationService.CreateApplication(newApp); _db.SaveChanges(); // Assert Assert.IsNotNull(response); Assert.AreEqual(response.Id, expected.Id); _applicationService.DeleteApplication(response.Id); _db.SaveChanges(); } }
public void CreatePasswordReset_Pass() { //Arrange var newUser = tu.CreateUserObject(); tu.CreateUserInDb(newUser); //Act using (_db = tu.CreateDataBaseContext()) { PasswordManager pm = new PasswordManager(_db); var response = pm.CreatePasswordReset(newUser.Id); //Assert Assert.IsNotNull(response); } }
public void LoginCheckUserExists_Success_ReturnTrue() { // Arrange User newUser = tu.CreateUserInDbManager(); bool result; request.email = newUser.Email; request.password = "******"; using (var _db = tu.CreateDataBaseContext()) { // Act result = lm.LoginCheckUserExists(request.email); // Assert Assert.AreEqual(true, result); um.DeleteUser(newUser.Id); _db.SaveChanges(); } }