コード例 #1
0
        public void As_SIUnitSystem_ThrowsArgumentExceptionIfNotSupported()
        {
            var           quantity           = new ElectricCharge(value: 1, unit: ElectricCharge.BaseUnit);
            Func <object> AsWithSIUnitSystem = () => quantity.As(UnitSystem.SI);

            if (SupportsSIUnitSystem)
            {
                var value = (double)AsWithSIUnitSystem();
                Assert.Equal(1, value);
            }
            else
            {
                Assert.Throws <ArgumentException>(AsWithSIUnitSystem);
            }
        }