public void As_SIUnitSystem_ThrowsArgumentExceptionIfNotSupported() { var quantity = new SpecificVolume(value: 1, unit: SpecificVolume.BaseUnit); Func <object> AsWithSIUnitSystem = () => quantity.As(UnitSystem.SI); if (SupportsSIUnitSystem) { var value = (decimal)AsWithSIUnitSystem(); Assert.Equal(1, value); } else { Assert.Throws <ArgumentException>(AsWithSIUnitSystem); } }