public IEnumerable<Specification> Filter(Suite top)
{
if (Lifecycle == Lifecycle.Any && Suite.IsEmpty()) return top.GetAllSpecs();
IEnumerable<Specification> specs;
if (Suite.IsNotEmpty())
{
var suite = top.suites.FirstOrDefault(x => x.name == Suite);
if (suite == null)
throw new SuiteNotFoundException(Suite, top);
specs = suite.GetAllSpecs();
}
else
{
specs = top.GetAllSpecs();
}
if (Lifecycle != Lifecycle.Any)
{
specs = specs.Where(x => x.Lifecycle == Lifecycle);
}
return specs.ToArray();
}