public void SaveOpenTest() { FormRefSkeleton_Accessor target = new FormRefSkeleton_Accessor(); // TODO: 適切な値に初期化してください string filepath = "../../../Test2/refSkeleton.skl"; target.AddJointAnnotation(new JointAnnotation("j0", new PointF(10, 110))); target.AddJointAnnotation(new JointAnnotation("j0", new PointF(20, 120))); target.AddJointAnnotation(new JointAnnotation("j1", new PointF(30, 130))); target.AddJointAnnotation(new JointAnnotation("j2", new PointF(40, 140))); target.Save(filepath); target.Open(filepath); Assert.AreEqual(target.an.joints.Count, 4); Assert.AreEqual(target.an.joints[0].name, "j0"); Assert.AreEqual(target.an.joints[1].name, "j0"); Assert.AreEqual(target.an.joints[2].name, "j1"); Assert.AreEqual(target.an.joints[3].name, "j2"); Assert.AreEqual(target.an.joints[0].position.X, 10, 1e-4f); Assert.AreEqual(target.an.joints[1].position.X, 20, 1e-4f); Assert.AreEqual(target.an.joints[2].position.X, 30, 1e-4f); Assert.AreEqual(target.an.joints[3].position.X, 40, 1e-4f); Assert.AreEqual(target.an.joints[0].position.Y, 110, 1e-4f); Assert.AreEqual(target.an.joints[1].position.Y, 120, 1e-4f); Assert.AreEqual(target.an.joints[2].position.Y, 130, 1e-4f); Assert.AreEqual(target.an.joints[3].position.Y, 140, 1e-4f); }
public void AddJointAnnotationTest() { FormRefSkeleton_Accessor target = new FormRefSkeleton_Accessor(); // TODO: 適切な値に初期化してください target.Initialize(target.pictureBox1.Image as Bitmap); target.AddJointAnnotation(new JointAnnotation("head", new Point(50, 100))); Assert.AreEqual(target.an.joints.Count, 1); target.AddJointAnnotation(new JointAnnotation("head", new Point(80, 100))); Assert.AreEqual(target.an.joints.Count, 2); target.AddJointAnnotation(new JointAnnotation("waist", new Point(100, 100))); Assert.AreEqual(target.an.joints.Count, 3); }