Ejemplo n.º 1
0
        public void DecorateChunkGeneratorReturnsIncomingChunkGenerator()
        {
            // Arrange
            var expected = new RazorChunkGenerator("Foo", "Bar", "Baz", CreateHost());

            // Act
            var actual = CreateHost().DecorateChunkGenerator(expected);

            // Assert
            Assert.Same(expected, actual);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets an instance of the chunk generator and is provided an opportunity to decorate or replace it
        /// </summary>
        /// <param name="incomingChunkGenerator">The chunk generator</param>
        /// <returns>Either the same chunk generator, after modifications, or a different chunk generator</returns>
        public virtual RazorChunkGenerator DecorateChunkGenerator(RazorChunkGenerator incomingChunkGenerator)
        {
            if (incomingChunkGenerator == null)
            {
                throw new ArgumentNullException(nameof(incomingChunkGenerator));
            }

            return incomingChunkGenerator;
        }