public void TestOrPropertySetsChildAndReturnsNewOrElementWithParent() { const string name = "name_1"; const string value = "Value_1"; NUnitFilterContainerElement parent = new NUnitFilterContainerElement(null, NUnitElementType.RootFilter); INUnitFilterElementInternal element = new NUnitFilterElement(parent, NUnitElementType.Property, name, false, value); INUnitFilterElementCollectionInternal or = (INUnitFilterElementCollectionInternal)element.Or; Assert.IsNotNull(or); Assert.AreEqual(NUnitElementType.Or, or.ElementType); Assert.AreSame(element, or.Parent); Assert.AreSame(or, element.Child); }
public void TestWherePropertyReturnsNewRootFilterInstanceForEachCall() { INUnitFilterElementCollectionInternal firstWhere = (INUnitFilterElementCollectionInternal)NUnitFilter.Where; Assert.IsNotNull(firstWhere); Assert.IsNull(firstWhere.Parent); Assert.IsNull(firstWhere.Child); Assert.AreEqual(NUnitElementType.RootFilter, firstWhere.ElementType); INUnitFilterElementCollectionInternal secondWhere = (INUnitFilterElementCollectionInternal)NUnitFilter.Where; Assert.IsNotNull(secondWhere); Assert.IsNull(secondWhere.Parent); Assert.IsNull(secondWhere.Child); Assert.AreEqual(NUnitElementType.RootFilter, secondWhere.ElementType); Assert.AreNotSame(firstWhere, secondWhere); }