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_ProcessIsNotRunning_DoesNotCallItExpire() { IPointerUpInputProcessStateConstArg arg = CreateMockArg(); TestAbsPointerUpInputProcessState state = new TestAbsPointerUpInputProcessState(arg); IUIAdaptorInputProcess process = Substitute.For <IUIAdaptorInputProcess>(); process.IsRunning().Returns(false); state.SetProcess_Test(process); state.ExpireProcess(); process.DidNotReceive().Expire(); }
public void OnExit_ProcessIsRunning_CallsItStop() { IPointerUpInputProcessStateConstArg arg = CreateMockArg(); TestAbsPointerUpInputProcessState state = new TestAbsPointerUpInputProcessState(arg); IUIAdaptorInputProcess process = Substitute.For <IUIAdaptorInputProcess>(); process.IsRunning().Returns(true); state.SetProcess_Test(process); state.OnExit(); process.Received(1).Stop(); }
public void ExpireProcess_ProcessIsRunning_ExpiresIt() { IPointerDownInputProcessStateConstArg arg = CreateMockArg(); TestAbsPointerDownInputProcessState state = new TestAbsPointerDownInputProcessState(arg); IUIAdaptorInputProcess process = Substitute.For <IUIAdaptorInputProcess>(); process.IsRunning().Returns(true); state.SetProcess(process); state.ExpireProcess(); process.Received(1).Expire(); }
public void OnExit_ProcessIsNotRunning_DoesNotStopIt() { IPointerDownInputProcessStateConstArg arg = CreateMockArg(); TestAbsPointerDownInputProcessState state = new TestAbsPointerDownInputProcessState(arg); IUIAdaptorInputProcess process = Substitute.For <IUIAdaptorInputProcess>(); process.IsRunning().Returns(false); state.SetProcess(process); state.OnExit(); process.DidNotReceive().Stop(); }