コード例 #1
0
        IFixtureFilter CreateFilter()
        {
            FixtureFilterBase filter = FixtureFilters.Any;

            if (FilterAuthors != null)
            {
                foreach (string include in FilterAuthors.GetIncludePatterns())
                {
                    filter = FixtureFilters.And(filter, FixtureFilters.Author(include));
                }
            }

            if (FilterCategories != null)
            {
                foreach (string include in FilterCategories.GetIncludePatterns())
                {
                    filter = FixtureFilters.And(filter, FixtureFilters.Category(include));
                }

                foreach (string exclude in FilterCategories.GetExcludePatterns())
                {
                    filter = FixtureFilters.And(filter, FixtureFilters.Category(exclude, true));
                }
            }

            if (FilterNamespaces != null)
            {
                foreach (string include in FilterNamespaces.GetIncludePatterns())
                {
                    filter = FixtureFilters.And(filter, FixtureFilters.Namespace(include));
                }
            }

            if (FilterTypes != null)
            {
                foreach (string include in FilterTypes.GetIncludePatterns())
                {
                    filter = FixtureFilters.And(filter, FixtureFilters.Type(include));
                }
            }

            return(filter);
        }
コード例 #2
0
ファイル: MainArguments.cs プロジェクト: tmauldin/mb-unit
        public FixtureFilterBase GetFilter()
        {
            FixtureFilterBase filter = FixtureFilters.Any;

            if (this.FilterCategory != null)
            {
                filter = FixtureFilters.And(
                    filter,
                    FixtureFilters.Category(this.FilterCategory)
                    );
            }
            else if (this.ExcludeCategory != null)
            {
                filter = FixtureFilters.And(filter, FixtureFilters.Category(this.ExcludeCategory, true));
            }
            if (this.FilterAuthor != null)
            {
                filter = FixtureFilters.And(
                    filter,
                    FixtureFilters.Author(this.FilterAuthor)
                    );
            }
            if (this.FilterNamespace != null)
            {
                filter = FixtureFilters.And(
                    filter,
                    FixtureFilters.Namespace(this.FilterNamespace)
                    );
            }
            if (this.FilterType != null)
            {
                filter = FixtureFilters.And(
                    filter,
                    FixtureFilters.Type(this.FilterType)
                    );
            }
            return(filter);
        }