public void OnEnter_CreatesAndRunsProcess()
    {
        IPointerUpInputProcessStateConstArg arg   = CreateMockArg();
        TestAbsPointerUpInputProcessState   state = new TestAbsPointerUpInputProcessState(arg);

        state.OnEnter();

        IUIAdaptorInputProcess process = state.GetProcess_Test();

        process.Received(1).Run();
    }
    public void ExpireProcess_ProcessIsRunning_CallsItExpire()
    {
        IPointerUpInputProcessStateConstArg arg   = CreateMockArg();
        TestAbsPointerUpInputProcessState   state = new TestAbsPointerUpInputProcessState(arg);
        IUIAdaptorInputProcess process            = Substitute.For <IUIAdaptorInputProcess>();

        process.IsRunning().Returns(true);
        state.SetProcess_Test(process);

        state.ExpireProcess();

        process.Received(1).Expire();
    }
Ejemplo n.º 3
0
    public void OnExit_ProcessIsRunning_StopsIt()
    {
        IPointerDownInputProcessStateConstArg arg   = CreateMockArg();
        TestAbsPointerDownInputProcessState   state = new TestAbsPointerDownInputProcessState(arg);
        IUIAdaptorInputProcess process = Substitute.For <IUIAdaptorInputProcess>();

        process.IsRunning().Returns(true);
        state.SetProcess(process);

        state.OnExit();

        process.Received(1).Stop();
    }