Ejemplo n.º 1
0
        public void CreateChunkGeneratorMethodPassesChunkGeneratorThroughDecorateMethodOnHost()
        {
            // Arrange
            var mockHost = new Mock<RazorEngineHost>(new CSharpRazorCodeLanguage()) { CallBase = true };

            var expected = new Mock<RazorChunkGenerator>("Foo", "Bar", "Baz", mockHost.Object).Object;

            mockHost.Setup(h => h.DecorateChunkGenerator(It.IsAny<RazorChunkGenerator>()))
                .Returns(expected);
            var engine = new RazorTemplateEngine(mockHost.Object);

            // Act
            var actual = engine.CreateChunkGenerator("Foo", "Bar", "Baz");

            // Assert
            Assert.Equal(expected, actual);
        }
Ejemplo n.º 2
0
        public void CreateChunkGeneratorMethodPassesChunkGeneratorThroughDecorateMethodOnHost()
        {
            // Arrange
            var mockHost = new Mock <RazorEngineHost>(new CSharpRazorCodeLanguage())
            {
                CallBase = true
            };

            var expected = new Mock <RazorChunkGenerator>("Foo", "Bar", "Baz", mockHost.Object).Object;

            mockHost.Setup(h => h.DecorateChunkGenerator(It.IsAny <RazorChunkGenerator>()))
            .Returns(expected);
            var engine = new RazorTemplateEngine(mockHost.Object);

            // Act
            var actual = engine.CreateChunkGenerator("Foo", "Bar", "Baz");

            // Assert
            Assert.Equal(expected, actual);
        }