public void GetComponentInHierarchyTest_ComponentInParent_IncludeInActive_SetInactive() { GetComponentInHierarchyTester tester = Setup (includeInActive: true, componentInParent: true, setActive: false); TestComponent result = tester.Run(); Assert.NotNull(result); }
private GetComponentInHierarchyTester Setup(bool includeInActive, bool componentInParent, bool setActive) { _parent = new GameObject(); _child = new GameObject(); _grandChild = new GameObject(); _child.transform.parent = _parent.transform; _grandChild.transform.parent = _child.transform; GetComponentInHierarchyTester tester = _child.AddComponent <GetComponentInHierarchyTester>(); tester.Setup(includeInActive, componentInParent, setActive); return(tester); }