public void GetComponentInHierarchyTest_ComponentInParet_DontIncludeInactive_SetInactive() { GetComponentInHierarchyTester tester = Setup(false, true, false); TestComponent result = tester.Run(); Assert.IsNull(result); }
public void GetComponentInHierarchyTest_ComponentInChild_IncludeInactive_SetInactive() { GetComponentInHierarchyTester tester = Setup(true, false, false); TestComponent result = tester.Run(); Assert.NotNull(result); }
public void GetComponentInHierarchyTest_ComponentInParet_IncludeInactive_SetActive() { GetComponentInHierarchyTester tester = Setup(incluneInactive: true, componentInParent: true, setActive: true); TestComponent result = tester.Run(); Assert.NotNull(result); }
private GetComponentInHierarchyTester Setup(bool incluneInactive, bool componentInParent, bool setActive) { _paret = new GameObject(); _child = new GameObject(); _grandChild = new GameObject(); _child.transform.parent = _paret.transform; _grandChild.transform.parent = _child.transform; GetComponentInHierarchyTester tester = _child.AddComponent <GetComponentInHierarchyTester>(); tester.Setup(incluneInactive, componentInParent, setActive); return(tester); }