public void TestMethodThrowsArgumentExceptionWhenMethodNameIsNullOrEmpty(
            [Values] bool isNull)
        {
            string       name   = isNull ? null : string.Empty;
            const string value  = "Value_1";
            const string xmlTag = "parent_1";
            XmlSerializableElementForTest parent =
                new XmlSerializableElementForTest(xmlTag, value, NUnitElementType.Test);

            INUnitFilterContainerElementInternal element =
                new NUnitFilterContainerElement(parent, NUnitElementType.And);

            Assert.Throws(
                Is.TypeOf <ArgumentException>().And.Message
                .EqualTo("The name cannot be null or empty. (Parameter 'name')"), () =>
            {
                // ReSharper disable once UnusedVariable
                INUnitFilterElement method = element.Method(name);
            });
        }
        public void TestMethodSetsChildAndReturnsNewAndElementWithParent(
            [Values] bool isRegularExpression)
        {
            const string name   = "name_1";
            const string value  = "Value_1";
            const string xmlTag = "parent_1";
            XmlSerializableElementForTest parent =
                new XmlSerializableElementForTest(xmlTag, value, NUnitElementType.Test);

            INUnitFilterContainerElementInternal element =
                new NUnitFilterContainerElement(parent, NUnitElementType.And);

            INUnitFilterElementInternal
                method = (INUnitFilterElementInternal)element.Method(name, isRegularExpression);

            Assert.IsNotNull(method);
            Assert.AreEqual(NUnitElementType.Method, method.ElementType);
            Assert.AreSame(element, method.Parent);
            Assert.AreSame(method, element.Child);
            Assert.AreEqual(name, method.ElementName);
            Assert.IsNull(method.ElementValue);
            Assert.AreEqual(isRegularExpression, method.IsRegularExpression);
        }