FilterInfo

Namespace: Gallio
We found 10 examples in language CSharp for this search. You will see 22 fragments of code.
        [Fact]
        public void ActionFilters_ReturnsEmptyArray_WhenFiltersIsEmpty()
        {
            // Arrange
            IEnumerable<FilterInfo> filters = CreateEmptyFilters();
            FilterGrouping product = CreateProductUnderTest(filters);

            // Act
            IActionFilter[] actionFilters = product.ActionFilters;
            
            // Assert
            Assert.NotNull(actionFilters);
            Assert.Equal(0, actionFilters.Length);
        }

        private static IEnumerable<FilterInfo> CreateEmptyFilters()
        {
            return new FilterInfo[0];
        }

        private static FilterGrouping CreateProductUnderTest(IEnumerable<FilterInfo> filters)
        {
            return new FilterGrouping(filters);
        }


        [Theory]
        [PropertyData("CompareTestData")]
        public void Compare(FilterInfo x, FilterInfo y, int expectedSign)
        {
            int result = FilterInfoComparer.Instance.Compare(x, y);

            Assert.Equal(expectedSign, Math.Sign(result));
        }

        [Obsolete]
        void AddFilters(FilterInfo filterInfo);
        [Obsolete]
        void IFilterProvider.AddFilters(FilterInfo filterInfo) {
            AddFilters(filterInfo);
        }

        [Obsolete]
        void AddFilters(FilterInfo filterInfo);
        [Obsolete]
        void IFilterProvider.AddFilters(FilterInfo filterInfo) {
            AddFilters(filterInfo);
        }


        [Theory]
        [PropertyData("CompareTestData")]
        public void Compare(FilterInfo x, FilterInfo y, int expectedSign)
        {
            int result = FilterInfoComparer.Instance.Compare(x, y);

            Assert.Equal(expectedSign, Math.Sign(result));
        }

        [Fact]
        public void Constructor_Default()
        {
            // Arrange + Act
            FilterInfo filterInfo = new FilterInfo();

            // Assert
            Assert.Empty(filterInfo.ActionFilters);
            Assert.Empty(filterInfo.AuthorizationFilters);
            Assert.Empty(filterInfo.ExceptionFilters);
            Assert.Empty(filterInfo.ResultFilters);
        }

        [Fact]
        public void Constructor_IteratesOverFiltersOnlyOnce()
        {
            // Arrange
            var filtersMock = new Mock<IEnumerable<Filter>>();
            filtersMock.Setup(f => f.GetEnumerator()).Returns(new List<Filter>().GetEnumerator());

            // Act
            FilterInfo filterInfo = new FilterInfo(filtersMock.Object);

            // Assert
            filtersMock.Verify(f => f.GetEnumerator(), Times.Once());
        }

        [Fact]
        public void ActionFilters_ReturnsEmptyArray_WhenFiltersIsEmpty()
        {
            // Arrange
            IEnumerable<FilterInfo> filters = CreateEmptyFilters();
            FilterGrouping product = CreateProductUnderTest(filters);

            // Act
            IActionFilter[] actionFilters = product.ActionFilters;
            
            // Assert
            Assert.NotNull(actionFilters);
            Assert.Equal(0, actionFilters.Length);
        }

        private static IEnumerable<FilterInfo> CreateEmptyFilters()
        {
            return new FilterInfo[0];
        }

        private static FilterGrouping CreateProductUnderTest(IEnumerable<FilterInfo> filters)
        {
            return new FilterGrouping(filters);
        }

        [Obsolete]
        void AddFilters(FilterInfo filterInfo);
        [Obsolete]
        void IFilterProvider.AddFilters(FilterInfo filterInfo) {
            AddFilters(filterInfo);
        }

        [Fact]
        public void ActionFilters_ReturnsEmptyArray_WhenFiltersIsEmpty()
        {
            // Arrange
            IEnumerable<FilterInfo> filters = CreateEmptyFilters();
            FilterGrouping product = CreateProductUnderTest(filters);

            // Act
            IActionFilter[] actionFilters = product.ActionFilters;
            
            // Assert
            Assert.NotNull(actionFilters);
            Assert.Equal(0, actionFilters.Length);
        }

        private static IEnumerable<FilterInfo> CreateEmptyFilters()
        {
            return new FilterInfo[0];
        }

        private static FilterGrouping CreateProductUnderTest(IEnumerable<FilterInfo> filters)
        {
            return new FilterGrouping(filters);
        }

        [Fact]
        public void ActionFilters_ReturnsEmptyArray_WhenFiltersIsEmpty()
        {
            // Arrange
            IEnumerable<FilterInfo> filters = CreateEmptyFilters();
            FilterGrouping product = CreateProductUnderTest(filters);

            // Act
            IActionFilter[] actionFilters = product.ActionFilters;
            
            // Assert
            Assert.NotNull(actionFilters);
            Assert.Equal(0, actionFilters.Length);
        }

        private static IEnumerable<FilterInfo> CreateEmptyFilters()
        {
            return new FilterInfo[0];
        }

        private static FilterGrouping CreateProductUnderTest(IEnumerable<FilterInfo> filters)
        {
            return new FilterGrouping(filters);
        }

Gallio.Runner.Projects.Schema.FilterInfo : IValidatable

Constructors :

public FilterInfo(String filterName = , String filterExpr = )

Methods :

public String get_FilterName()
public Void set_FilterName(String value = )
public String get_FilterExpr()
public Void set_FilterExpr(String value = )
public FilterInfo Copy()
public Void Validate()
public Type GetType()
public String ToString()
public Boolean Equals(Object obj = )
public Int32 GetHashCode()

Other methods

Other methods