Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

55 lines
1.1 KiB
C#

// ****************************************************************
// This is free software licensed under the NUnit license. You
// may obtain a copy of the license as well as information regarding
// copyright ownership at http://nunit.org/?p=license&r=2.4.
// ****************************************************************
using System;
using System.Collections;
using NUnit.Core;
namespace NUnit.Util
{
public class CategoryManager
{
private Hashtable categories = new Hashtable();
public void Add(string name)
{
categories[name] = name;
}
public void Add(IList list)
{
foreach(string name in list)
{
Add(name);
}
}
public void AddCategories( ITest test )
{
if ( test.Categories != null )
Add( test.Categories );
}
public void AddAllCategories( ITest test )
{
AddCategories( test );
if ( test.IsSuite )
foreach( ITest child in test.Tests )
AddAllCategories( child );
}
public ICollection Categories
{
get { return categories.Values; }
}
public void Clear()
{
categories = new Hashtable();
}
}
}