public void ShouldHandleScalingInBaseUnitIdentityConversion(
            [Values(-3,-2,-1,0,1,2,3)] int toExp,
            [Values(-3,-2,-1,0,1,2,3)] int fromExp)
        {
            var q = 1.5m;
            var m = new Measurement(q, fromExp, "B");

            var siUnits = new InternationalSystem();
            Assert.That(Converters.Convert(m, string.Format("{0}{1}", siUnits.ToPrefix(toExp), "B")),
                Is.EqualTo(new Measurement(q * (decimal)Math.Pow(10, fromExp - toExp), toExp, "B")));
        }
 public void ShouldConvertInternationalSystemUnitsToBaseUnit(
     [Values("YV", "ZV", "EV", "PV", "TV", "GV", "MV", "kV", "hV", "daV", "V", "dV", "cV", "mV", "µV", "nV", "pV", "fV", "aV", "zV", "yV")]
     string units)
 {
     var siUnits = new InternationalSystem();
     Assert.That(siUnits.BaseUnits(units), Is.EqualTo("V"));
 }
 public void ShouldConvertInternationalSystemUnitsToExponent(
     [Values("YV", "ZV", "EV", "PV", "TV", "GV", "MV", "kV", "hV", "daV", "V", "dV", "cV", "mV", "µV", "nV", "pV", "fV", "aV", "zV", "yV")]
     string units,
     [Values(24, 21, 18, 15, 12, 9, 6, 3, 2, 1, 0, -1, -2, -3, -6, -9, -12, -15, -18, -21, -24)] int exponent)
 {
     var siUnits = new InternationalSystem();
     Assert.That(siUnits.Exponent(units), Is.EqualTo(exponent));
 }
 public void ShouldConvertInternationalSystemPrefixToExponent(
     [Values("Y", "Z", "E", "P", "T", "G", "M", "k", "h", "da", "", "d", "c", "m", "µ", "n", "p", "f", "a", "z", "y")]
     string prefix,
     [Values(24,21,18,15,12,9,6,3,2,1,0,-1,-2,-3,-6,-9,-12,-15,-18,-21,-24)] int exponent)
 {
     var siUnits = new InternationalSystem();
     Assert.That(siUnits.ToExponent(prefix), Is.EqualTo(exponent));
 }