public void GetBillPeriodChartData_ValidParams_ReturnsResponse()
        {
            var test = orchestrator.GetBillPeriodChartData(validGetBillPeriodChartDataRequest).Result;

            Assert.IsNotNull(test);
            Assert.AreEqual(1, test.Data.Count);
            Assert.IsInstanceOf <GetBillPeriodChartDataResponse>(test);
        }
Beispiel #2
0
        public void GetBillPeriodChartData_ExceptionThrown_ReturnsErrorResponse()
        {
            var test = orchestrator.GetBillPeriodChartData(invalidUserId, string.Empty).Result;

            Assert.IsInstanceOf <OrchestratorResponseWrapper <IList <KeyValuePair <TimePeriod, int> > > >(test);
            Assert.IsNotNull(test);
            Assert.IsNull(test.Model);
            Assert.AreEqual(test.Errors.Count, 1);
            Assert.IsFalse(test.Success);
        }
        public async Task <ActionResult> GetPeriodChartData()
        {
            var modelWrapper = await chartOrchestrator.GetBillPeriodChartData(UserId, UserEmail);

            return(JsonResponse(modelWrapper));
        }
Beispiel #4
0
        public async Task <IHttpActionResult> GetPeriodChartData([FromUri] GetBillPeriodChartDataRequest request)
        {
            var response = await orchestrator.GetBillPeriodChartData(request);

            return(Ok(response));
        }