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); }
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); }