Exemplo n.º 1
0
        public void ExportedWholeWeeeRedirectCalled_ShouldReturnCorrectRoute()
        {
            Guid orgId    = Guid.NewGuid();
            Guid returnId = Guid.NewGuid();

            RedirectToRouteResult newRoute = AeRedirect.ExportedWholeWeee(orgId, returnId);

            Assert.Equal(AeRedirect.ReturnsRouteName, newRoute.RouteName);
            Assert.Equal("Returns", newRoute.RouteValues["controller"]);
            Assert.Equal("ExportedWholeWeee", newRoute.RouteValues["action"]);
            Assert.Equal(orgId, newRoute.RouteValues["organisationId"]);
            Assert.Equal(returnId, newRoute.RouteValues["returnId"]);
        }
Exemplo n.º 2
0
        public async Task <ActionResult> Index(ReturnsViewModel viewModel)
        {
            using (var client = apiClient())
            {
                AddReturn request = new AddReturn()
                {
                    OrganisationId = viewModel.OrganisationId,
                    FacilityType   = FacilityType.Ae,
                    Quarter        = viewModel.Quarter,
                    Year           = viewModel.ComplianceYear
                };

                Guid returnId = await client.SendAsync(User.GetAccessToken(), request);

                return(AeRedirect.ExportedWholeWeee(viewModel.OrganisationId, returnId));
            }
        }