本文整理汇总了C#中Speed.ToMillimetersPerSecond方法的典型用法代码示例。如果您正苦于以下问题:C# Speed.ToMillimetersPerSecond方法的具体用法?C# Speed.ToMillimetersPerSecond怎么用?C# Speed.ToMillimetersPerSecond使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Speed
的用法示例。
在下文中一共展示了Speed.ToMillimetersPerSecond方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestConvertion
public void TestConvertion()
{
Speed speed = new Speed(5, SpeedUnit.MetersPerSecond);
Assert.AreEqual(5, speed.Value);
Speed ftps = speed.ToFeetPerSecond();
Assert.AreEqual(16.40419, ftps.Value, 0.00001);
Assert.AreEqual(SpeedUnit.FeetPerSecond, ftps.Units);
Speed kph = speed.ToKilometersPerHour();
Assert.AreEqual(18, kph.Value);
Assert.AreEqual(SpeedUnit.KilometersPerHour, kph.Units);
Speed kps = speed.ToKilometersPerSecond();
Assert.AreEqual(0.005, kps.Value, 0.001);
Assert.AreEqual(SpeedUnit.KilometersPerSecond, kps.Units);
Speed knots = speed.ToKnots();
Assert.AreEqual(9.71922246, knots.Value, 0.00001);
Assert.AreEqual(SpeedUnit.Knots, knots.Units);
Speed meterps = speed.ToMetersPerSecond();
Assert.AreEqual(5, meterps.Value);
Assert.AreEqual(SpeedUnit.MetersPerSecond, meterps.Units);
Speed mmps = speed.ToMillimetersPerSecond();
Assert.AreEqual(5000, mmps.Value);
Assert.AreEqual(SpeedUnit.MillimetersPerSecond, mmps.Units);
Speed mph = speed.ToStatuteMilesPerHour();
Assert.AreEqual(11.1846815, mph.Value, 0.00001);
Assert.AreEqual(SpeedUnit.StatuteMilesPerHour, mph.Units);
}