예제 #1
0
        public void Velocity_ToUnit_When_ConvertingFromKiloMeterPerHourToMeterPerSecond_Then_ResultShouldBeAsExpected(
            double velocity,
            double expected)
        {
            var testee = new Velocity(velocity, x => x.Kilo.Meters / x.Hours);

            var result = testee.ToUnit(x => x.Meters / x.Seconds);

            result.Should().BeApproximately(expected, "m/s", TestHelper.DefaultAssertPrecision);
        }
예제 #2
0
        public void Velocity_ToUnit_When_UnitsAreDifferent_Then_ResultShouldBeAsExpected(
            double velocity,
            double expected)
        {
            var testee = new Velocity(velocity, x => x.Miles / x.Hours);

            var result = testee.ToUnit(x => x.Kilo.Meters / x.Hours);

            result.Should().BeApproximately(expected, "km/h", TestHelper.DefaultAssertPrecision);
        }