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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        public async Task <ActionResult> Manage()
        {
            var modelWrapper = await orchestrator.GetBillsForUser(UserId, UserEmail);

            AddModelErrors(modelWrapper.Errors);
            AddModelWarnings(modelWrapper.Warnings);

            return(View("Manage", modelWrapper.Model));
        }
Пример #4
0
        public async Task <IHttpActionResult> GetBillsForUser([FromUri] GetBillsForUserRequest request)
        {
            var response = await orchestrator.GetBillsForUser(request);

            return(Ok(response));
        }