public void TestIdWithTestIdArraySetsChildAndReturnsNewAndElementWithParent()
        {
            const string name1 = "name_1";
            const string name2 = "name_2";
            const string name3 = "name_3";

            string[]     names  = { name1, null, name2, string.Empty, name3 };
            const string value  = "Value_1";
            const string xmlTag = "parent_1";
            XmlSerializableElementForTest parent =
                new XmlSerializableElementForTest(xmlTag, value, NUnitElementType.Test);
            const string expectedName = name1 + "," + name2 + "," + name3;

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

            INUnitFilterElementInternal id = (INUnitFilterElementInternal)element.Id(names);

            Assert.IsNotNull(id);
            Assert.AreEqual(NUnitElementType.Id, id.ElementType);
            Assert.AreSame(element, id.Parent);
            Assert.AreSame(id, element.Child);
            Assert.AreEqual(expectedName, id.ElementName);
            Assert.IsNull(id.ElementValue);
            Assert.IsFalse(id.IsRegularExpression);
        }
        TestIdThrowsArgumentExceptionWhenMultipleTestIdsContainsOnlyNullOrEmptyValues()
        {
            const string value  = "Value_1";
            const string xmlTag = "name_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 id = element.Id(null, string.Empty);
            });
        }
        public void TestIdThrowsArgumentExceptionWhenTestIdArrayNullOrEmpty(
            [Values] bool isNull)
        {
            string[]     names  = isNull ? null : Array.Empty <string>();
            const string value  = "Value_1";
            const string xmlTag = "name_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 testIds cannot be null or empty. (Parameter 'testIds')"), () =>
            {
                // ReSharper disable once UnusedVariable
                INUnitFilterElement id = element.Id(names);
            });
        }
        public void TestIdWithSingleTestIdSetsChildAndReturnsNewAndElementWithParent()
        {
            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 id = (INUnitFilterElementInternal)element.Id(name);

            Assert.IsNotNull(id);
            Assert.AreEqual(NUnitElementType.Id, id.ElementType);
            Assert.AreSame(element, id.Parent);
            Assert.AreSame(id, element.Child);
            Assert.AreEqual(name, id.ElementName);
            Assert.IsNull(id.ElementValue);
            Assert.IsFalse(id.IsRegularExpression);
        }