public void WithExpressionAsDateTimeReturnsCorrectly()
        {
            var viewModel = new DateViewModel( new DateTime( 2000, 1, 1 ) );

            HtmlHelper<DateViewModel> htmlHelper = HtmlHelperGenerator.CreateHtmlHelper( viewModel );

            var result = htmlHelper.DateFor( x => x.Date );

            string expectedResult = string.Format( "<input id=\"Date\" name=\"Date\" type=\"date\" value=\"{0}\" />", viewModel.Date.ToString( "yyyy-MM-dd" ) );
            Assert.AreEqual( expectedResult, result.ToHtmlString() );
        }
        public void WithExpressionReturnsCorrectly()
        {
            var viewModel = new DateViewModel( "2000-01-01" );

            HtmlHelper<DateViewModel> htmlHelper = HtmlHelperGenerator.CreateHtmlHelper( viewModel );

            var result = htmlHelper.DateFor( x => x.DateAsString );

            string expectedResult = string.Format( "<input id=\"DateAsString\" name=\"DateAsString\" type=\"date\" value=\"{0}\" />", viewModel.DateAsString );
            Assert.AreEqual( expectedResult, result.ToHtmlString() );
        }
        public void WithExpressionAndHtmlAttributesDictionaryReturnsCorrectly()
        {
            var viewModel = new DateViewModel( "2000-01-01" );
            string attributeName = "attributeName";
            string attributeValue = "attributeValue";

            Dictionary<string, object> htmlAttributes = new Dictionary<string, object>();
            htmlAttributes.Add( attributeName, attributeValue );

            HtmlHelper<DateViewModel> htmlHelper = HtmlHelperGenerator.CreateHtmlHelper( viewModel );

            var result = htmlHelper.DateFor( x => x.DateAsString, htmlAttributes );

            string expectedResult = string.Format( "<input {0}=\"{1}\" id=\"DateAsString\" name=\"DateAsString\" type=\"date\" value=\"{2}\" />", attributeName, attributeValue, viewModel.DateAsString );
            Assert.AreEqual( expectedResult, result.ToHtmlString() );
        }