public void CreateFilterTracers_IFilter_With_All_Filter_Interfaces_Returns_3_Wrapped_Filters()
        {
            // Arrange
            IFilter filter = new TestFilterAllBehaviors();

            // Act
            IFilter[] wrappedFilters = FilterTracer.CreateFilterTracers(filter, new TestTraceWriter()).ToArray();

            // Assert
            Assert.Equal(3, wrappedFilters.Length);
            Assert.Equal(1, wrappedFilters.OfType <ActionFilterTracer>().Count());
            Assert.Equal(1, wrappedFilters.OfType <AuthorizationFilterTracer>().Count());
            Assert.Equal(1, wrappedFilters.OfType <ExceptionFilterTracer>().Count());
        }
Beispiel #2
0
        public void CreateFilterTracers_IFilter_With_All_Filter_Interfaces_Returns_Wrapped_Filters_For_Each_Filter()
        {
            // Arrange
            IFilter filter = new TestFilterAllBehaviors();

            // Act
            IFilter[] wrappedFilters = FilterTracer.CreateFilterTracers(filter, new TestTraceWriter()).ToArray();

            // Assert
            Assert.Equal(5, wrappedFilters.Length);
            Assert.Single(wrappedFilters.OfType <ActionFilterTracer>());
            Assert.Single(wrappedFilters.OfType <AuthorizationFilterTracer>());
            Assert.Single(wrappedFilters.OfType <AuthenticationFilterTracer>());
            Assert.Single(wrappedFilters.OfType <ExceptionFilterTracer>());
            Assert.Single(wrappedFilters.OfType <OverrideFilterTracer>());
        }
        public void CreateFilterTracers_IFilter_With_All_Filter_Interfaces_Returns_4_Wrapped_Filters()
        {
            // Arrange
            IFilter filter = new TestFilterAllBehaviors();

            // Act
            IFilter[] wrappedFilters = FilterTracer.CreateFilterTracers(filter, new TestTraceWriter()).ToArray();

            // Assert
            Assert.Equal(4, wrappedFilters.Length);
            Assert.Equal(1, wrappedFilters.OfType<ActionFilterTracer>().Count());
            Assert.Equal(1, wrappedFilters.OfType<AuthorizationFilterTracer>().Count());
            Assert.Equal(1, wrappedFilters.OfType<AuthenticationFilterTracer>().Count());
            Assert.Equal(1, wrappedFilters.OfType<ExceptionFilterTracer>().Count());
        }