Наследование: NAnt.Core.Element
Пример #1
0
 public void Append(IncludeSet includeSet)
 {
     foreach (string patternName in includeSet.GetIncludePatterns())
     {
         Pattern pattern = new Pattern { PatternName = patternName };
         Include.Add(pattern);
     }
 }
        public void Should_create_category_include_filter()
        {
            Pattern pattern = new Pattern { PatternName = IncludedCategory };
            _sut.FilterCategories.Include.Add(pattern);

            IFixtureFilter filter = (IFixtureFilter) Reflector.InvokeMethod(_sut, "CreateFilter");

            Assert.IsFalse(filter.Filter(typeof(NoAttributes)), "The NoAttributes type should be excluded");
            Assert.IsTrue(filter.Filter(typeof(IncludeCategory)), "The IncludeCategory type should be included");
        }
Пример #3
0
        public void Append(FilterSet filterSet)
        {
            foreach (string include in filterSet.GetIncludePatterns())
            {
                Pattern pattern = new Pattern { PatternName = include };
                Include.Add(pattern);
            }

            foreach (string exclude in filterSet.GetExcludePatterns())
            {
                Pattern pattern = new Pattern { PatternName = exclude };
                Exclude.Add(pattern);
            }
        }
Пример #4
0
 /// <summary>
 /// Inserts a <see cref="Pattern"/> into the collection at the specified index.
 /// </summary>
 /// <param name="index">The zero-based index at which <paramref name="item"/> should be inserted.</param>
 /// <param name="item">The <see cref="Pattern"/> to insert.</param>
 public void Insert(int index, Pattern item)
 {
     List.Insert(index, item);
 }
Пример #5
0
 /// <summary>
 /// Retrieves the index of a specified <see cref="Pattern"/> object in the collection.
 /// </summary>
 /// <param name="item">The <see cref="Pattern"/> object for which the index is returned.</param> 
 /// <returns>
 /// The index of the specified <see cref="Pattern"/>. If the <see cref="Pattern"/> is not currently a member of the collection, it returns -1.
 /// </returns>
 public int IndexOf(Pattern item)
 {
     return List.IndexOf(item);
 }
Пример #6
0
 /// <summary>
 /// Copies the entire collection to a compatible one-dimensional array,
 /// starting at the specified index of the target array.        
 /// </summary>
 /// <param name="array">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> 
 /// <param name="index">The zero-based index in <paramref name="array"/> at which copying begins.</param>
 public void CopyTo(Pattern[] array, int index)
 {
     List.CopyTo(array, index);
 }
Пример #7
0
 /// <summary>
 /// Determines whether a <see cref="Pattern"/> is in the collection.
 /// </summary>
 /// <param name="item">The <see cref="Pattern"/> to locate in the collection.</param> 
 /// <returns>
 /// <see langword="true" /> if <paramref name="item"/> is found in the 
 /// collection; otherwise, <see langword="false" />.
 /// </returns>
 public bool Contains(Pattern item)
 {
     return List.Contains(item);
 }
Пример #8
0
 /// <summary>
 /// Adds the elements of a <see cref="Pattern"/> array to the end of the collection.
 /// </summary>
 /// <param name="items">The array of <see cref="Pattern"/> elements to be added to the end of the collection.</param> 
 public void AddRange(Pattern[] items)
 {
     for (int i = 0; (i < items.Length); i = (i + 1)) {
         Add(items[i]);
     }
 }
Пример #9
0
 /// <summary>
 /// Adds a <see cref="Pattern"/> to the end of the collection.
 /// </summary>
 /// <param name="item">The <see cref="Pattern"/> to be added to the end of the collection.</param> 
 /// <returns>The position into which the new element was inserted.</returns>
 public int Add(Pattern item)
 {
     return List.Add(item);
 }
Пример #10
0
 /// <summary>
 /// Removes a member from the collection.
 /// </summary>
 /// <param name="item">The <see cref="Pattern"/> to remove from the collection.</param>
 public void Remove(Pattern item)
 {
     List.Remove(item);
 }
Пример #11
0
 /// <summary>
 /// Inserts a <see cref="Pattern"/> into the collection at the specified index.
 /// </summary>
 /// <param name="index">The zero-based index at which <paramref name="item"/> should be inserted.</param>
 /// <param name="item">The <see cref="Pattern"/> to insert.</param>
 public void Insert(int index, Pattern item)
 {
     List.Insert(index, item);
 }
Пример #12
0
 /// <summary>
 /// Retrieves the index of a specified <see cref="Pattern"/> object in the collection.
 /// </summary>
 /// <param name="item">The <see cref="Pattern"/> object for which the index is returned.</param>
 /// <returns>
 /// The index of the specified <see cref="Pattern"/>. If the <see cref="Pattern"/> is not currently a member of the collection, it returns -1.
 /// </returns>
 public int IndexOf(Pattern item)
 {
     return(List.IndexOf(item));
 }
Пример #13
0
 /// <summary>
 /// Determines whether a <see cref="Pattern"/> is in the collection.
 /// </summary>
 /// <param name="item">The <see cref="Pattern"/> to locate in the collection.</param>
 /// <returns>
 /// <see langword="true" /> if <paramref name="item"/> is found in the
 /// collection; otherwise, <see langword="false" />.
 /// </returns>
 public bool Contains(Pattern item)
 {
     return(List.Contains(item));
 }
Пример #14
0
 /// <summary>
 /// Adds a <see cref="Pattern"/> to the end of the collection.
 /// </summary>
 /// <param name="item">The <see cref="Pattern"/> to be added to the end of the collection.</param>
 /// <returns>The position into which the new element was inserted.</returns>
 public int Add(Pattern item)
 {
     return(List.Add(item));
 }
Пример #15
0
 /// <summary>
 /// Removes a member from the collection.
 /// </summary>
 /// <param name="item">The <see cref="Pattern"/> to remove from the collection.</param>
 public void Remove(Pattern item)
 {
     List.Remove(item);
 }
Пример #16
0
 private static Pattern MakePattern(string path)
 {
     Pattern ret = new Pattern();
     ret.PatternName = path;
     return ret;
 }
        public void Should_create_namespace_include_filter()
        {
            Pattern pattern = new Pattern { PatternName = GetType().Namespace };
            _sut.FilterNamespaces.Include.Add(pattern);

            IFixtureFilter filter = (IFixtureFilter) Reflector.InvokeMethod(_sut, "CreateFilter");

            Assert.IsTrue(filter.Filter(typeof(NoAttributes)), "The NoAttributes type should be included");
            Assert.IsFalse(filter.Filter(typeof(object)), "The object type should be excluded");
        }