public async Task ShouldProcessChainTest2IncludingDefaults()
        {
            // Arrange
            var factory  = this.provider.GetRequiredService <IAsyncExtenderFactory <string, string> >();
            var extender = factory.Create("TEST2");

            var structure = new TestCollection("TEST-1", new List <TestComponent>
            {
                new TestItem("TEST-1-1"),
                new TestCollection("TEST-1-2", new List <TestComponent>()
                {
                    new TestItem("TEST-2-1"),
                    new TestItem("TEST-2-2")
                })
            });

            // Act
            await structure.Accept(extender);

            // Assert
            this.logger.VerifyTimes(LogLevel.Information, 2);
            this.logger.VerifyTimes(LogLevel.Error, 3);

            this.logger.VerifyContains(LogLevel.Error, "DEFAULT!!");
            this.logger.VerifyContains(LogLevel.Information, "TEST-1");
            this.logger.VerifyContains(LogLevel.Information, "TEST-1-2");
        }
Ejemplo n.º 2
0
        public async Task ShouldProcessChain()
        {
            // Arrange
            var extender  = this.provider.GetRequiredService <IAsyncExtender <string> >();
            var structure = new TestCollection("TEST-1", new List <TestComponent>
            {
                new TestItem("TEST-1-1"),
                new TestCollection("TEST-1-2", new List <TestComponent>()
                {
                    new TestItem("TEST-2-1"),
                    new TestItem("TEST-2-2")
                })
            });

            // Act
            await structure.Accept(extender);

            // Assert
            this.logger.VerifyTimes(LogLevel.Information, 5);
            this.logger.VerifyContains(LogLevel.Information, "TEST-1");
            this.logger.VerifyContains(LogLevel.Information, "TEST-1-1");
            this.logger.VerifyContains(LogLevel.Information, "TEST-1-2");
            this.logger.VerifyContains(LogLevel.Information, "TEST-2-1");
            this.logger.VerifyContains(LogLevel.Information, "TEST-2-2");
        }
        public void ShouldProcessChainTest1Successfully()
        {
            // Arrange
            var factory  = this.provider.GetRequiredService <IExtenderFactory <string, string> >();
            var extender = factory.Create("TEST1");

            var structure = new TestCollection("TEST-1", new List <TestComponent>
            {
                new TestItem("TEST-1-1"),
                new TestCollection("TEST-1-2", new List <TestComponent>()
                {
                    new TestItem("TEST-2-1"),
                    new TestItem("TEST-2-2")
                })
            });

            // Act
            structure.Accept(extender);

            // Assert
            this.logger.VerifyTimes(LogLevel.Information, 5);
            this.logger.VerifyContains(LogLevel.Information, "TEST-1");
            this.logger.VerifyContains(LogLevel.Information, "TEST-1-1");
            this.logger.VerifyContains(LogLevel.Information, "TEST-1-2");
            this.logger.VerifyContains(LogLevel.Information, "TEST-2-1");
            this.logger.VerifyContains(LogLevel.Information, "TEST-2-2");
        }