public void ApproximateVelocityTest() { DateTime dtg = DateTime.Now; Observation target = new Observation { DateTime = dtg, X = 1, Y = 1, Z = 1 }; Observation pastObservation = new Observation { DateTime = dtg.AddSeconds(3), X = 0, Y = 1, Z = 2 }; Velocity expected = new Velocity { DateTime = dtg, X = (-1F / 3F), Y = 0, Z = (1F / 3F) }; Velocity actual; actual = target.ApproximateVelocity(pastObservation); Assert.IsTrue(Math.Abs(actual.X - expected.X) < 0.0001); Assert.IsTrue(Math.Abs(actual.Y - expected.Y) < 0.0001); Assert.IsTrue(Math.Abs(actual.Z - expected.Z) < 0.0001); }