public void BindPropertiesAreSet()
        {
            // arrange
            var tagHelperProvider = new TagHelperContainer();
            tagHelperProvider.Register<TestTagHelper>("foo");

            // act
            var tagHelper = (TestTagHelper) tagHelperProvider
                .GetTagHelper("foo", new[] {new TagAttribute("controller", "Home"), new TagAttribute("action", "Index")});

            // assert
            Assert.AreEqual("Home", tagHelper.Controller);
            Assert.AreEqual("Index", tagHelper.Action);
        }
        public void ActionLinkTest(String input, string expected)
        {
            // arrange
            var writer = new StringWriter();
            var tagHelperProvider = new TagHelperContainer();
            tagHelperProvider.Register<TestTagHelper>("foo");

            var mng = new HtmlProcessor(writer, tagHelperProvider);
            var bytes = writer.Encoding.GetBytes(input);
            // act
            mng.Write(bytes, 0, bytes.Length);
            // assert
            Assert.AreEqual(expected, writer.GetStringBuilder().ToString());
        }
 public void TransformTest(String input, string expected)
 {
     // arrange
     var writer = new StringWriter();
     var tagHelperProvider = new TagHelperContainer();
     tagHelperProvider.Register<TagC>("c");
     tagHelperProvider.Register<TagWithNs>("xn:div");
     var mng = new HtmlProcessor(writer, tagHelperProvider);
     // act
     foreach(var ch in input)
         mng.Write(ch);
     // assert
     Assert.AreEqual(expected, writer.GetStringBuilder().ToString());
 }
        public void BindPropertiesAreSet()
        {
            // arrange
            var tagHelperProvider = new TagHelperContainer();

            tagHelperProvider.Register <TestTagHelper>("foo");

            // act
            var tagHelper = (TestTagHelper)tagHelperProvider
                            .GetTagHelper("foo", new[] { new TagAttribute("controller", "Home"), new TagAttribute("action", "Index") });

            // assert
            Assert.AreEqual("Home", tagHelper.Controller);
            Assert.AreEqual("Index", tagHelper.Action);
        }
        public void ActionLinkTest(String input, string expected)
        {
            // arrange
            var writer            = new StringWriter();
            var tagHelperProvider = new TagHelperContainer();

            tagHelperProvider.Register <TestTagHelper>("foo");

            var mng   = new HtmlProcessor(writer, tagHelperProvider);
            var bytes = writer.Encoding.GetBytes(input);

            // act
            mng.Write(bytes, 0, bytes.Length);
            // assert
            Assert.AreEqual(expected, writer.GetStringBuilder().ToString());
        }
        public void TransformTest(String input, string expected)
        {
            // arrange
            var writer            = new StringWriter();
            var tagHelperProvider = new TagHelperContainer();

            tagHelperProvider.Register <TagC>("c");
            tagHelperProvider.Register <TagWithNs>("xn:div");
            var mng = new HtmlProcessor(writer, tagHelperProvider);

            // act
            foreach (var ch in input)
            {
                mng.Write(ch);
            }
            // assert
            Assert.AreEqual(expected, writer.GetStringBuilder().ToString());
        }