Exemple #1
0
        public ActionResult Index(string sortOrder = "ratingDescending", string message = "")
        {
            var          viewer  = new StoryViewer();
            List <Story> stories = null;

            switch (sortOrder)
            {
            case "ratingDescending":
                stories = viewer.ShowAllStoriesHighestRatingFirst();
                break;

            case "dateCreatedDescending":
                stories = viewer.ShowAllStoriesByDateCreatedDescending();
                break;
            }

            DisplayMessageToUserIfRequired(message);
            return(View(stories));
        }
Exemple #2
0
        public void ShowAllStories()
        {
            List <Story> result = _viewer.ShowAllStoriesHighestRatingFirst();

            Assert.Equal(3, result.Count);
        }