/// <summary>
        /// Helper method for building paging links.
        /// </summary>
        /// <param name="htmlHelper">The HTML helper.</param>
        /// <param name="pagingInfo">The paging info.</param>
        /// <param name="pageUrl">The page URL.</param>
        /// <returns></returns>
        public static MvcHtmlString PageLinks( this HtmlHelper htmlHelper, PagingInfo pagingInfo, Func<int, string> pageUrl )
        {
            StringBuilder stringBuilder = new StringBuilder();

            for( int i = 1; i <= pagingInfo.TotalPages; i++ )
            {
                // Build a page index's link
                TagBuilder anchorTagBuilder = new TagBuilder( "a" );
                anchorTagBuilder.MergeAttribute( "href", pageUrl( i ) );
                anchorTagBuilder.InnerHtml = string.Format( "{0}", i.ToString(CultureInfo.InvariantCulture) );
                // Define current page index's style
                if( i == pagingInfo.CurrentPageIndex )
                {
                    anchorTagBuilder.AddCssClass( "selected" );
                }
                stringBuilder.Append( anchorTagBuilder );
            }
            return MvcHtmlString.Create( stringBuilder.ToString() );
        }
        public void Can_Generate_Page_Links()
        {
            // Arrange - Define HtmlHelper, at the moment we'd just instantiate it from current default type which takes null params on its contructor args
            HtmlHelper htmlHelper = null;

            // Arrange - Expected result
            StringBuilder expectedBuilder = new StringBuilder();
            expectedBuilder.Append(string.Format("<a class=\"{0}\" href=\"{1}\">{2}</a>", "selected", buildPageUrl(1), 1));
            expectedBuilder.Append(string.Format("<a href=\"{0}\">{1}</a>", buildPageUrl(2), 2));

            // Arrange - Create paging info 
            PagingInfo pagingInfo = new PagingInfo { CurrentPageIndex = 1, ItemsPerPage = 2, TotalItems = 4 };

            // Arrange - Setup the pageUrl delegate 
            Func<int, string> pageUrlDelegate = buildPageUrl;

            // Act:
            MvcHtmlString result = htmlHelper.PageLinks(pagingInfo, pageUrlDelegate);

            // Assert:
            String expected = expectedBuilder.ToString();
            String actual = result.ToString();
            Assert.AreEqual(expected, actual);
        }