public void GetBillsForUser_InvalidParams_ReturnsErrorResponse() { var test = orchestrator.GetBillsForUser(invalidBillViewModel.Id, validUsername).Result; Assert.IsInstanceOf <OrchestratorResponseWrapper <ManageBillsViewModel> >(test); Assert.IsNotNull(test); Assert.IsNull(test.Model); Assert.AreEqual(1, test.Errors.Count); }
public void GetBillsForUser_ValidParams_ReturnsResponse() { var test = orchestrator.GetBillsForUser(validGetBillsForUserRequest).Result; Assert.IsNotNull(test); Assert.IsInstanceOf <GetBillsForUserResponse>(test); Assert.IsNotNull(test.Bills); Assert.AreEqual(1, test.Bills.Count); Assert.IsTrue(test.Success); }
public async Task <ActionResult> Manage() { var modelWrapper = await orchestrator.GetBillsForUser(UserId, UserEmail); AddModelErrors(modelWrapper.Errors); AddModelWarnings(modelWrapper.Warnings); return(View("Manage", modelWrapper.Model)); }
public async Task <IHttpActionResult> GetBillsForUser([FromUri] GetBillsForUserRequest request) { var response = await orchestrator.GetBillsForUser(request); return(Ok(response)); }