public void GetBillCategoryChartData_ValidParams_ReturnsResponse() { var test = orchestrator.GetBillCategoryChartData(validGetBillCategoryChartDataRequest).Result; Assert.IsNotNull(test); Assert.AreEqual(1, test.Data.Count); Assert.IsInstanceOf <GetBillCategoryChartDataResponse>(test); }
public void GetBillCategoryChartData_ExceptionThrown_ReturnsErrorResponse() { var test = orchestrator.GetBillCategoryChartData(invalidUserId, string.Empty).Result; Assert.IsInstanceOf <OrchestratorResponseWrapper <IList <KeyValuePair <string, int> > > >(test); Assert.IsNotNull(test); Assert.IsNull(test.Model); Assert.AreEqual(test.Errors.Count, 1); Assert.IsFalse(test.Success); }
public async Task <ActionResult> GetCategoryChartData() { var modelWrapper = await chartOrchestrator.GetBillCategoryChartData(UserId, UserEmail); return(JsonResponse(modelWrapper)); }
public async Task <IHttpActionResult> GetCategoryChartData([FromUri] GetBillCategoryChartDataRequest request) { var response = await orchestrator.GetBillCategoryChartData(request); return(Ok(response)); }