public void ConstructorTest1()
        {
            try {
                IavaSkeleton skeleton = new IavaSkeleton()
                {
                    ClippedEdges = IavaFrameEdges.Left,
                    Position = new IavaSkeletonPoint() { X = 1.0f, Y = 2.0f, Z = 3.0f },
                    TrackingId = 531,
                    TrackingState = IavaSkeletonTrackingState.Tracked
                };

                // Create the object
                IavaSkeletonEventArgs iavaEventArgs = new IavaSkeletonEventArgs(skeleton);

                // Make sure the property set correctly
                Assert.AreEqual(skeleton, iavaEventArgs.Skeleton);
            }
            catch (Exception ex) {
                Assert.Fail(ex.Message);
            }
        }
        /// <summary>
        /// Preps the IavaSkeleton object so it can be tested for performed gestures
        /// </summary>
        /// <param name="sender">Event sender</param>
        /// <param name="e">IavaSkeletonEventArgs containing the Skeleton object</param>
        protected void OnSkeletonReady(object sender, IavaSkeletonEventArgs e)
        {
            if (!_detectingGestures) { return; }

            IavaSkeletonPoint translationVector = e.Skeleton.Joints[IavaJointType.HipCenter].Position;

            IavaJoint joint = new IavaJoint();

            // Translate all the points in the skeleton to the center of the kinect view
            for (IavaJointType jointID = 0; jointID < IavaJointType.Count; jointID++) {
                // Refer to http://stackoverflow.com/questions/1003772/setting-margin-properties-in-code
                // for why things are done this way
                joint = e.Skeleton.Joints[jointID];
                joint.Position = Geometry.Translate(joint.Position, translationVector);

                // Set the point to the point with the updated position
                e.Skeleton.Joints[jointID] = joint;
            }

            // If we're synced up look for gestures
            if (m_isSynced) { _engine.CheckForGesture(e.Skeleton); }

            // Check for the sync gesture
            else { _engine.CheckForSyncGesture(e.Skeleton); }
        }
 /// <summary>
 /// Handles the SkeletonReady event of the IRuntime control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="IavaSkeletonEventArgs"/> instance containing the event data.</param>
 private static void OnSkeletonReady(object sender, IavaSkeletonEventArgs e)
 {
     if (SkeletonReady != null) { SkeletonReady(null, e); }
 }
        public void EqualityTest()
        {
            try {
                IavaSkeleton_Accessor accessor1 = new IavaSkeleton_Accessor()
                {
                    ClippedEdges = IavaFrameEdges.Left,
                    Position = new IavaSkeletonPoint() { X = 1.0f, Y = 2.0f, Z = 3.0f },
                    TrackingId = 531,
                    TrackingState = IavaSkeletonTrackingState.Tracked
                };

                IavaSkeleton_Accessor accessor2 = new IavaSkeleton_Accessor()
                {
                    ClippedEdges = IavaFrameEdges.Left,
                    Position = new IavaSkeletonPoint() { X = 1.0f, Y = 2.0f, Z = 3.0f },
                    TrackingId = 531,
                    TrackingState = IavaSkeletonTrackingState.Tracked
                };

                IavaSkeleton_Accessor accessor3 = new IavaSkeleton_Accessor()
                {
                    ClippedEdges = IavaFrameEdges.Left,
                    Position = new IavaSkeletonPoint() { X = 3.0f, Y = 2.0f, Z = 1.0f },
                    TrackingId = 450,
                    TrackingState = IavaSkeletonTrackingState.Tracked
                };

                IavaSkeletonEventArgs eventArgs1 = new IavaSkeletonEventArgs((IavaSkeleton)accessor1.Target);
                IavaSkeletonEventArgs eventArgs2 = new IavaSkeletonEventArgs((IavaSkeleton)accessor2.Target);
                IavaSkeletonEventArgs eventArgs3 = new IavaSkeletonEventArgs((IavaSkeleton)accessor3.Target);
                IavaSkeletonEventArgs eventArgs4 = new IavaSkeletonEventArgs((IavaSkeleton)null);
                IavaSkeletonEventArgs eventArgs5 = new IavaSkeletonEventArgs((IavaSkeleton)null);

                // Make sure eventArgs1 does not equal null
                Assert.IsFalse(eventArgs1 == null);

                // Make sure null does not equal eventArgs1
                Assert.IsFalse(null == eventArgs1);

                // Make sure eventArgs1 and eventArgs3 are not equal
                Assert.IsFalse(eventArgs1 == eventArgs3);

                // Make sure eventArgs1 and eventArgs2 are equal
                Assert.IsTrue(eventArgs1 == eventArgs2);

                // Make sure eventArgs4 and eventArgs5 are equal
                Assert.IsTrue(eventArgs4 == eventArgs5);

                // Make sure eventArgs1 equals itself
                Assert.IsTrue(eventArgs1 == eventArgs1);
            }
            catch (Exception ex) {
                Assert.Fail(ex.Message);
            }
        }