public void Should_activate_simple_step() { var m1 = Movement.Forward(_cam.LeftHand, 10); var step = new GestureStep(TimeSpan.FromHours(1), m1); var completed = false; step.StepCompleted += () => completed = true; step.Activate(); _cam.MoveLeftHandZ(30); _cam.MoveLeftHandZ(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); }
public void Should_Report_Progress() { double progress = 0; _movement.Progress += d => progress = d; _camera.MoveLeftHandZ(2); _camera.MoveLeftHandZ(1); Assert.IsTrue(progress > 0); }