public void Velocity_Division_Then_ResultShouldBeExpected(double lhs, double rhs, double expected) { var testee1 = new Velocity(lhs, selector => selector.Meters / selector.Seconds); var testee2 = new Velocity(rhs, selector => selector.Meters / selector.Seconds); var result = testee1 / testee2; result.Should().Be(expected); }
public void Velocity_ToString_When_UnitModeIsSpecified_Then_ResultShouldBeExpected( UnitFormat unitFormat, string expected) { var testee = new Velocity(1, x => x.Kilo.Meters / x.Hours); var result = testee.ToString(unitFormat); result.Should().Be(expected); }
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); }
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); }
public void Velocity_Division_When_DividingWithAnyNumber_Then_ResultShouldBeExpected( double lhs, double rhs, double expected) { var testee = new Velocity(lhs, selector => selector.Meters / selector.Seconds); var result = testee / rhs; result.Should().Be(expected, "m/s"); }
public void Velocity_Division_When_RhsIsLength_Then_ResultShouldBeExpected( double lhs, double rhs, double expected) { var testee1 = new Velocity(lhs, selector => selector.Meters / selector.Seconds); var testee2 = new Time(rhs, x => x.Seconds); var result = testee1 / testee2; result.Should().Be(expected, "m/s" + Constants.Exponent2); }
public void Distance_Division_When_RhsIsVelocity_Then_ResultShouldBeExpected( double lhs, double rhs, double expected) { var testee1 = new Distance(lhs, x => x.Meters); var testee2 = new Velocity(rhs, selector => selector.Meters / selector.Seconds); var result = testee1 / testee2; result.Should().BeApproximately(expected, "s"); }
public void Distance_Division_When_RhsIsVelocityAndPrefixesAreDifferent_Then_ResultShouldBeExpected( double lhs, double rhs, double expected) { var testee1 = new Distance(lhs, x => x.Centi.Meters); var testee2 = new Velocity(rhs, selector => selector.Meters / selector.Seconds); var result = testee1 / testee2; result.Should().BeApproximately(expected, "s", TestHelper.DefaultAssertPrecision); }