public WelcomeHUDController() { view = CreateView(); view.SetVisible(false); CommonScriptableObjects.tutorialActive.OnChange -= TutorialActive_OnChange; CommonScriptableObjects.tutorialActive.OnChange += TutorialActive_OnChange; CommonScriptableObjects.emailPromptActive.OnChange -= EmailPromptActive_OnChange; CommonScriptableObjects.emailPromptActive.OnChange += EmailPromptActive_OnChange; }
public void ReactToViewOnButtonConfirm(int buttonIndexToPress) { // Arrange IWelcomeHUDView mockView = Substitute.For <IWelcomeHUDView>(); mockView.When(x => x.Initialize(Arg.Any <UnityAction <int> >(), Arg.Any <UnityAction>(), Arg.Any <MessageOfTheDayConfig>())) .Do(x => x.ArgAt <UnityAction <int> >(0).Invoke(buttonIndexToPress)); WelcomeHUDController controller = Substitute.ForPartsOf <WelcomeHUDController>(); // Act controller.Initialize(null); // Assert controller.Received().OnConfirmPressed(buttonIndexToPress); mockView.Received().SetVisible(false); }