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

namespace CoverageFramework.Operator.Selector.Python3
{
	[Export(typeof(IXElementSelector))]
	public class IfConditionSelector : IXElementSelector
	{
		public IEnumerable<XElement> Select(XElement root)
		{
			return root.Descendants()
				.Where(e => e.Name.LocalName == "if_stmt")
				.SelectMany(e => e.Elements("test"));
		}
	}
}