using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;

namespace CoverageFramework.Operator.Selector
{
	public abstract class XElementSelector : IXElementSelector
	{
		protected abstract IEnumerable<XElement> SelectContainingNull(XElement root);

		public IEnumerable<XElement> Select(XElement root)
		{
			return SelectContainingNull(root)
				.Where(e => e != null);
		}
	}
}