public void RegisterUser_ValidParams_ReturnsResponse() { var test = orchestrator.RegisterUser(validRegisterUserRequest).Result; Assert.IsNotNull(test); Assert.IsInstanceOf <RegisterUserResponse>(test); Assert.True(test.RegisterSuccess); }
public void RegisterUser_InvalidRequest_ReturnsError() { var task = orchestrator.RegisterUser(invalidRegisterViewModel); task.Wait(); var test = task.Result; Assert.IsNotNull(test); Assert.IsInstanceOf <OrchestratorResponseWrapper <bool> >(test); Assert.AreEqual(1, test.Errors.Count); Assert.AreEqual(0, test.Warnings.Count); Assert.IsFalse(test.Success); Assert.IsFalse(test.Model); }
public async Task <ActionResult> Register(RegisterViewModel model) { if (!ModelState.IsValid) { return(View(model)); } var registerResponse = await orchestrator.RegisterUser(model); if (registerResponse.Success) { return(RedirectToAction("BudgetOverview", "Budget", new { area = "Dashboard" })); } AddModelErrors(registerResponse.Errors); return(View(model)); }
public async Task <IHttpActionResult> RegisterUser([FromBody] RegisterUserRequest request) { var response = await orchestrator.RegisterUser(request); return(Ok(response)); }