public void Should_activate_double_step() { var m1 = Movement.Forward(_cam.LeftHand, 10); var m2 = Movement.Forward(_cam.RightHand, 10); var step = new GestureStep(TimeSpan.FromHours(1), m1, m2); var completed = false; step.StepCompleted += () => completed = true; step.Activate(); _cam.MoveLeftHandZ(30); _cam.MoveLeftHandZ(20); _cam.MoveRightHandZ(30); _cam.MoveRightHandZ(20); Assert.IsTrue(completed); }
public void Should_go_to_next_step() { var step = 0; var b = new Gesture(); b.AddStep(50000, Movement.Forward(_cam.LeftHand, 10), Movement.Forward(_cam.RightHand, 10)); b.AddStep(50000, Movement.Left(_cam.LeftHand, 10), Movement.Right(_cam.RightHand, 10)); b.NextStep += (s, a) => { step = a.Step; }; b.Activate(); _cam.MoveLeftHandZ(30); _cam.MoveLeftHandZ(20); _cam.MoveRightHandZ(30); _cam.MoveRightHandZ(20); Assert.AreEqual(1, step); }