Exemplo n.º 1
0
        public void FirstRenderDoesntMessWithSecondRender()
        {
            var damangingRuleSetMock = new Mock<RuleSet>();
            damangingRuleSetMock.Setup(d => d.Render(It.IsAny<CQ>(), It.IsAny<IYateDataContext>()))
                .Callback((CQ html, IYateDataContext data) => html.Select("body").Text("hi"));

            var view = new ParsedView(CQ.Create(EmptyHtmlString));
            view.RuleSets.Add(damangingRuleSetMock.Object);

            Assert.AreEqual("<html><head></head><body>hi</body></html>", view.Render(new Mock<IYateDataContext>().Object));

            view.RuleSets.Clear();
            Assert.AreEqual(EmptyHtmlString, view.Render(new Mock<IYateDataContext>().Object));
        }
Exemplo n.º 2
0
        public void EmptyRendorTests()
        {
            var view = new ParsedView(CQ.Create(EmptyHtmlString));

            Assert.AreEqual(EmptyHtmlString, view.Render(new Mock<IYateDataContext>().Object));
        }