DWMTestEntry EncodersTest(EncodersData encoders, params DWMCommand[] command) { return (client, world, asserter) => { DWMSensorsData data = new DWMSensorsData(); foreach (var c in command) data = client.Act(c); asserter.IsEqual(encoders.TotalLeftRotation.Radian, data.Encoders.Sum(x => x.TotalLeftRotation.Radian), 0); asserter.IsEqual(encoders.TotalRightRotation.Radian, data.Encoders.Sum(x => x.TotalRightRotation.Radian),0); }; }
DWMTestEntry GAXTest(Point3D accelerations, Angle AroundX, Angle AroundY, Angle AroundZ, params DWMCommand[] command) { return (client, world, asserter) => { DWMSensorsData data = new DWMSensorsData(); foreach (var c in command) data = client.Act(c); asserter.IsEqual(accelerations.X, data.GAX.Last().Accelerations.X, 0); asserter.IsEqual(accelerations.Y, data.GAX.Last().Accelerations.Y, 0); asserter.IsEqual(accelerations.Z, data.GAX.Last().Accelerations.Z, 0); asserter.IsEqual(AroundZ.Radian, data.GAX.Last().VelocityAroundZ.Radian, 0); }; }