public static User CreateTestUser(string testName, string testAuth0Id, int refId = 0) { var user = RegisterController.CreateUser(new Auth0User() { Auth0Id = testAuth0Id, Auth0Nickname = testName }, refId); TryRemoveTestUser(testAuth0Id); using (var dbContext = TestUtils.CreateDatabase()) { dbContext.User.Add(user); dbContext.SaveChanges(); return(user); } }