Exemplo n.º 1
0
    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>());
        }
            );
    }
Exemplo n.º 2
0
    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>());
        }
            );
    }