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

namespace CoverageFramework.Operator.Decorator.Java
{
	public class BranchCoverageDecoratorForJava : ITaggedXElementDecorator
	{
		#region ITaggedXElementDecorator メンバ

		public XElement[] Generate(IEnumerable<XElement> elements, string tag)
		{
			return new[] {
				new XElement("ASimpleMethodInvocation",
					new XElement("TIdentifier", "CovMan"),
					new XElement("AAdditionalIdentifier",
						new XElement("TDot", "."),
						new XElement("TIdentifier", "branch")),
					new XElement("TLPar", "("),
					new XElement("AManyExArgumentList", // 変数のみの場合は AManyIdArgumentList
						new XElement("AStringLiteral",
							new XElement("TStringLiteral", '"' + tag + '"')),
						new XElement("TComma", ","),
						elements),
					new XElement("TRPar", ")")),
			};
		}

		#endregion
	}
}