public void RotatorContent_Action_Returns_View()
        {
            //Arrange
            _sponsorRepository.FindAll().ReceivedWithAnyArgs().Returns(new List <Sponsor>());

            //Act
            var controller = new ContentController(_sponsorRepository, _waitListHelper);
            var result     = controller.RotatorContent();

            //Assert
            result.AssertPartialViewRendered();
        }
Пример #2
0
        public static HttpResponseMessage Run(
            [HttpTrigger(AuthorizationLevel.Function, "get", Route = "sperrov1/sponsors")] HttpRequestMessage req,
            [Inject(typeof(ISponsorRepository))] ISponsorRepository sponsorRepository,
            TraceWriter log)
        {
            log.Info("C# HTTP trigger function processed a request.");

            // Fetching the name from the path parameter in the request URL
            return(req.CreateResponse(HttpStatusCode.OK, JsonConvert.SerializeObject(sponsorRepository.FindAll())));
        }
Пример #3
0
        public ActionResult Index()
        {
            var sponsors = _sponsorRepository.FindAll();

            var viewModel = BuildSponsorsViewModel(sponsors);

            viewModel.Contributors.Shuffle();
            viewModel.Sponsors.Shuffle();

            return(View(viewModel));
        }
Пример #4
0
        public ActionResult RotatorContent()
        {
            var sponsors = GetSponsorsFromCache();

            if (sponsors == null)
            {
                sponsors = (from s in _sponsorRepository.FindAll()
                            where s.IsContributor == false
                            select s).ToList();
                HttpRuntime.Cache.Insert("LeftHandPanelSponsors", sponsors);
            }

            sponsors.Shuffle();
            return(PartialView(sponsors));
        }
        public ActionResult Sponsors()
        {
            IEnumerable <Sponsor> sponsors = _sponsorRepository.FindAll();

            return(View(sponsors));
        }