public async Task Show_Redirects_To_FrontEnd()
        {
            var providerCode = "PROVIDERCODE";

            var frontendUrlMock = new Mock <IFrontendUrlService>();

            frontendUrlMock.Setup(x => x.ShouldRedirectOrganisationShow()).Returns(true);
            frontendUrlMock.Setup(x => x.RedirectToFrontend("/organisations/" + providerCode)).Returns(new RedirectResult("frontend"));
            var controller = new OrganisationController(null, frontendUrlMock.Object);

            var result = await controller.Show(providerCode);

            Assert.IsTrue(result is RedirectResult);
        }
        public async Task Show()
        {
            var providerCode     = "PROVIDERCODE";
            var organisationName = "organisationName";
            // Todo: fix this ObservableCollection.
            var providerCourses = new List <Course>
            {
                new Course
                {
                    Provider = new GovUk.Education.ManageCourses.Domain.Models.Provider {
                        ProviderCode = providerCode, ProviderName = organisationName
                    }
                }
            };

            var orgs = new List <ProviderSummary>
            {
                new ProviderSummary(),
                new ProviderSummary
                {
                    ProviderCode = providerCode,
                    ProviderName = organisationName
                }
            };

            var apiMock = new Mock <IManageApi>();

            apiMock.Setup(x => x.GetCoursesOfProvider(providerCode)).ReturnsAsync(providerCourses);

            apiMock.Setup(x => x.GetProviderSummaries()).ReturnsAsync(orgs);

            apiMock.Setup(x => x.GetProviderSummary(It.IsAny <string>())).ReturnsAsync(orgs[1]);

            var frontendUrlMock = new Mock <IFrontendUrlService>();

            var controller = new OrganisationController(apiMock.Object, frontendUrlMock.Object);

            var result = await controller.Show(providerCode);

            var viewResult = result as ViewResult;

            Assert.IsNotNull(viewResult);
            var model = viewResult.ViewData.Model as CourseListViewModel;

            Assert.NotNull(model);

            Assert.IsTrue(model.MultipleOrganisations);
        }