Пример #1
0
        public void TouchPointContainerEnumeratorReset()
        {
            tlog.Debug(tag, $"TouchPointContainerEnumeratorReset START");

            using (TouchPointContainer container = TouchPointContainer.Repeat(new TouchPoint(1, TouchPoint.StateType.Started, 0.0f, 0.0f), 2))
            {
                var testingTarget = container.GetEnumerator();
                Assert.IsNotNull(testingTarget, "Should be not null!");
                Assert.IsInstanceOf <TouchPointContainer.TouchPointContainerEnumerator>(testingTarget, "Should be an Instance of TouchPointContainerEnumerator!");

                try
                {
                    testingTarget.Reset();
                }
                catch (Exception e)
                {
                    tlog.Debug(tag, e.Message.ToString());
                    Assert.Fail("Caught Exception : Failed!");
                }

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"TouchPointContainerEnumeratorReset END (OK)");
        }
Пример #2
0
        public void TouchPointContainerEnumeratorCurrentWithNullCurrentObject()
        {
            tlog.Debug(tag, $"TouchPointContainerEnumeratorCurrentWithNullCurrentObject START");

            using (TouchPointContainer container = TouchPointContainer.Repeat(new TouchPoint(1, TouchPoint.StateType.Started, 0.0f, 0.0f), 2))
            {
                var testingTarget = container.GetEnumerator();
                Assert.IsNotNull(testingTarget, "Should be not null!");
                Assert.IsInstanceOf <TouchPointContainer.TouchPointContainerEnumerator>(testingTarget, "Should be an Instance of TouchPointContainerEnumerator!");

                try
                {
                    testingTarget.MoveNext();
                    testingTarget.MoveNext();
                    testingTarget.MoveNext();
                    var result = testingTarget.Current;
                }
                catch (InvalidOperationException e)
                {
                    tlog.Debug(tag, e.Message.ToString());
                    testingTarget.Dispose();
                    tlog.Debug(tag, $"TouchPointContainerEnumeratorCurrentWithNullCurrentObject END (OK)");
                    Assert.Pass("Caught InvalidOperationException : Passed!");
                }
            }
        }
Пример #3
0
        public void TouchPointContainerEnumeratorMoveNext()
        {
            tlog.Debug(tag, $"TouchPointContainerEnumeratorMoveNext START");

            using (TouchPointContainer container = TouchPointContainer.Repeat(new TouchPoint(1, TouchPoint.StateType.Started, 0.0f, 0.0f), 2))
            {
                var testingTarget = container.GetEnumerator();
                Assert.IsNotNull(testingTarget, "Should be not null!");
                Assert.IsInstanceOf <TouchPointContainer.TouchPointContainerEnumerator>(testingTarget, "Should be an Instance of TouchPointContainerEnumerator!");

                var result = testingTarget.MoveNext();
                tlog.Debug(tag, "Current : " + result);

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"TouchPointContainerEnumeratorMoveNext END (OK)");
        }
Пример #4
0
        public void TouchPointContainerGetEnumerator()
        {
            tlog.Debug(tag, $"TouchPointContainerGetEnumerator START");

            var testingTarget = new TouchPointContainer();

            Assert.IsNotNull(testingTarget, "Should be not null!");
            Assert.IsInstanceOf <TouchPointContainer>(testingTarget, "Should be an Instance of TouchPointContainer!");

            TouchPoint[] arr = new TouchPoint[] { new TouchPoint(1, TouchPoint.StateType.Started, 0.0f, 0.0f), new TouchPoint(2, TouchPoint.StateType.Last, 100.0f, 100.0f) };

            testingTarget.CopyTo(arr);
            var result = testingTarget.GetEnumerator();

            tlog.Debug(tag, "Enumerator : " + result);

            testingTarget.Dispose();
            tlog.Debug(tag, $"TouchPointContainerGetEnumerator END (OK)");
        }