public void GetExpenditureChartData_ValidParams_ReturnsResponse() { var test = orchestrator.GetExpenditureChartData(validGetExpenditureChartDataRequest).Result; Assert.IsNotNull(test); Assert.AreEqual(1, test.Data.Count); Assert.IsInstanceOf <GetExpenditureChartDataResponse>(test); }
public void GetExpenditureChartData_ExceptionThrown_ReturnsErrorResponse() { var test = orchestrator.GetExpenditureChartData(-1, invalidUserId, string.Empty).Result; Assert.IsInstanceOf <OrchestratorResponseWrapper <IList <KeyValuePair <DateTime, double> > > >(test); Assert.IsNotNull(test); Assert.IsNull(test.Model); Assert.AreEqual(test.Errors.Count, 1); Assert.IsFalse(test.Success); }
public async Task <ActionResult> GetExpenditureChartData() { var modelWrapper = await chartOrchestrator.GetExpenditureChartData(DateTime.Now.Month, UserId, UserEmail); return(JsonResponse(modelWrapper)); }
public async Task <IHttpActionResult> GetExpenditureChartData([FromUri] GetExpenditureChartDataRequest request) { var response = await orchestrator.GetExpenditureChartData(request); return(Ok(response)); }