コード例 #1
0
    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;
    }
コード例 #2
0
ファイル: WelcomeHUDShould.cs プロジェクト: yemel/explorer
        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);
        }