public void DeleteUserAccountz_Fail_BadPassword() { var badPassword = "******"; var expected = new BadRequestObjectResult("Invalid password"); LoginRequest request = new LoginRequest { EmailAddress = "*****@*****.**", Password = badPassword }; var actual = uam.DeleteUserAccount(request); Assert.AreEqual(expected, actual); }
public ActionResult DeleteAccount([FromBody] LoginRequest request) { try { UserAccountManager _userAccountManager = new UserAccountManager(new MongoClient(MONGODB_CONNECTION_STRING)); return(_userAccountManager.DeleteUserAccount(request)); } catch { return(new StatusCodeResult(StatusCodes.Status500InternalServerError)); } }
public void DeleteUserAccount_WhenCalled_CheckIsDeleted() { var isDeleted = _accountManager.DeleteUserAccount(new Guid("01B6020C-382B-4D44-8DA3-7513FB785C1F")); Assert.IsTrue(isDeleted); }