public AbsPointerUpInputState( IUIAdaptorInputStateConstArg arg ) : base( arg ) { }
/* Up state * enter => * touchCounter reset * pointer down => * touch counter ++ * OnTouch( touchCounter) * WFTapState */ public WaitingForFirstTouchState( IUIAdaptorInputStateConstArg engine ) : base( engine ) { }
IUIAdaptorInputStateConstArg CreateMockArg() { IUIAdaptorInputStateConstArg arg = Substitute.For <IUIAdaptorInputStateConstArg>(); arg.engine.Returns(Substitute.For <IUIAdaptorInputStateEngine>()); return(arg); }
public void OnDrag_ThrowsException() { IUIAdaptorInputStateConstArg arg = CreateMockArg(); TestAbsPointerUpInputState state = new TestAbsPointerUpInputState(arg); Assert.Throws( Is.TypeOf(typeof(System.InvalidOperationException)). And.Message.EqualTo("OnDrag should be impossible when pointer is held up, something's wrong"), () => { state.OnDrag(Substitute.For <ICustomEventData>()); } ); }
public void OnBeginDrag_ThrowsException() { IUIAdaptorInputStateConstArg arg = CreateMockArg(); TestAbsPointerUpInputState state = new TestAbsPointerUpInputState(arg); Assert.Throws( Is.TypeOf(typeof(System.InvalidOperationException)). And.Message.EqualTo("OnBeginDrag should not be called while pointer is held up"), () => { state.OnBeginDrag(Substitute.For <ICustomEventData>()); } ); }
public AbsUIAdaptorInputState( IUIAdaptorInputStateConstArg arg ) { thisEngine = arg.engine; }