public IActionResult SingleDeleteUser(User operatedUser, string accountType) { User invokingUser = new User(0, null, null, null, null, null, accountType, true, null); try { return(Ok(_userManagementManager.SingleDeleteUser(invokingUser, operatedUser))); } catch { return(StatusCode(StatusCodes.Status500InternalServerError)); } }
public void SingleDeleteUser_Pass(int sysID, string fName, string lName, string email, string password, string salt, string accntType, bool accountStatus, string errMsg) { // Arrange // Initializing User objects to test // User to delete from DB User user = new User(sysID, fName, lName, email, password, salt, accntType, accountStatus, errMsg); // User performing operation User thisUser = new User(109, null, null, null, "meMEeiaj093QNGEJOW~~~", null, "System Admin", true, null); bool result = false; // Act _userManagementManager.SingleCreateUsers(thisUser, user); Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); try { result = _userManagementManager.SingleDeleteUser(thisUser, user); } catch (ArgumentException) { result = false; } catch (Exception) { } stopwatch.Stop(); Console.WriteLine("Elapsed = {0} ms", stopwatch.ElapsedMilliseconds); // Assert Assert.IsTrue(result); }