public void RegisterPopUp_PopUpToRegIsAncestorOfActive_DoesNotCallActivePopUp() { IUIElement rootUIE = Substitute.For <IUIElement>(); TestPopUpManager popUpManager = new TestPopUpManager(); popUpManager.SetRootUIElement(rootUIE); IPopUp popUpToRegister = Substitute.For <IPopUp>(); IPopUp activePopUp = Substitute.For <IPopUp>(); popUpToRegister.IsAncestorOf(activePopUp).Returns(true); popUpManager.SetActivePopUp_Test(activePopUp); popUpManager.RegisterPopUp(popUpToRegister); rootUIE.DidNotReceive().PopUpDisableRecursivelyDownTo(popUpToRegister); activePopUp.DidNotReceive().PopUpDisableRecursivelyDownTo(popUpToRegister); }