using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.IO;
using MEMS_Visualizer;
using System.Windows.Media.Media3D;
using System.Windows.Media.Animation; 

namespace MEMS_Visualizer_Tests
{
    class VisualizationRendererTestold
    {
        [TestMethod]
        public void loadData_WithValidData()
        {
            Vector3D[] testVectors = {
                                         new Vector3D(0.0, 0.0, 0.0),
                                         new Vector3D(1.0, 1.0, 1.0)
                                     };
            int[] thumbPos = {
                                 0,
                                 43
                             };

            MovementData testData = new MovementData();
            
            for (int i = 0; i < testVectors.Length; i++)
            {
                //testData.addRotation(testVectors[i], thumbPos[i]);
            }

            VisualizationRenderer renderer = new VisualizationRenderer(testData);

            Assert.AreEqual(testData.HandRotationSequence.Count, testData.ThetaSequence.Count);
            Assert.AreEqual(testData.HandRotationSequence.Count, renderer.handRotationAnimations.Count);

            int j = 0;
            foreach (Vector3D vector in testVectors)
            {
                Quaternion qx = new Quaternion(new Vector3D(1, 0, 0), vector.X);
                Quaternion qy = new Quaternion(new Vector3D(0, 1, 0), vector.Y);
                Quaternion qz = new Quaternion(new Vector3D(0, 0, 1), vector.Z);
                Quaternion qr = qz * qy * qx;

                Rotation3DAnimation rotation = new Rotation3DAnimation(new QuaternionRotation3D(qr), renderer.animationTime);
                //rotation.Completed += autoLoadNextAnimation;

                Storyboard storyboard = new Storyboard();
                storyboard.Children.Add(rotation);


                Assert.AreEqual(storyboard, renderer.handRotationAnimations[j]);

                j++;
            }
            

            
        }
    }
}
