示例#1
0
        /// <summary>
        /// Contruct a Measurement
        /// </summary>
        /// <param name="q">The (howevermany)s of (whatever)s we have</param>
        /// <param name="u">The (whatever)s we have (howevermany)s of</param>
        public Measurement(decimal q, string u)
        {
            var siUnits = new InternationalSystem();

            Quantity = q;
            Exponent = siUnits.Exponent(u);
            BaseUnit = siUnits.BaseUnit(u);
        }
示例#2
0
        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));
        }