public async void CreateUserAccountTest() { var createModel = new { Name = "Invitee Guy", EmailAddress = DataMocking.RandomString(10) + "@reactvr.com", Password = "******", }; Mock <HttpRequest> mockRequest = MoqHelper.CreateMockRequest(createModel); var userAccountFunctions = new UserAccountFunctions(); ObjectResult response = (ObjectResult)await userAccountFunctions.CreateUserAccount(mockRequest.Object, logger); Assert.True(response.StatusCode == 200); }
public async void ChangeEmailAddressTest() { var randomEmailAddress = DataMocking.RandomString(10) + "@reactvr.com"; var newRandomEmailAddress = DataMocking.RandomString(10) + "@reactvr.com"; var updateModel = new { Name = "Jane Doe", EmailAddress = randomEmailAddress, Password = "******", NewEmailAddress = newRandomEmailAddress }; Mock <HttpRequest> createMockRequest = MoqHelper.CreateMockRequest(updateModel); Mock <HttpRequest> changeMockRequest = MoqHelper.CreateMockRequest(updateModel); var userAccountFunctions = new UserAccountFunctions(); ObjectResult createResponse = (ObjectResult)await userAccountFunctions.CreateUserAccount(createMockRequest.Object, logger); ObjectResult response = (ObjectResult)await userAccountFunctions.ChangeEmailAddress(changeMockRequest.Object, logger); Assert.True(response.StatusCode == 200); }