@@ -256,6 +256,64 @@ public string ScientificNotationUpperIntervalFormatting(double value)
256
256
return Length . FromMeters ( value ) . ToString ( ) ;
257
257
}
258
258
259
+ [ Test ]
260
+ public void ShouldUseCorrectMicroSign ( )
261
+ {
262
+ // "\u00b5" = Micro sign
263
+ Assert . AreEqual ( AccelerationUnit . MicrometerPerSecondSquared , Acceleration . ParseUnit ( "\u00b5 m/s²" ) ) ;
264
+ Assert . AreEqual ( AmplitudeRatioUnit . DecibelMicrovolt , AmplitudeRatio . ParseUnit ( "dB\u00b5 V" ) ) ;
265
+ Assert . AreEqual ( AngleUnit . Microdegree , Angle . ParseUnit ( "\u00b5 °" ) ) ;
266
+ Assert . AreEqual ( AngleUnit . Microradian , Angle . ParseUnit ( "\u00b5 rad" ) ) ;
267
+ Assert . AreEqual ( AreaUnit . SquareMicrometer , Area . ParseUnit ( "\u00b5 m²" ) ) ;
268
+ Assert . AreEqual ( DurationUnit . Microsecond , Duration . ParseUnit ( "\u00b5 s" ) ) ;
269
+ Assert . AreEqual ( ElectricCurrentUnit . Microampere , ElectricCurrent . ParseUnit ( "\u00b5 A" ) ) ;
270
+ Assert . AreEqual ( ElectricPotentialUnit . Microvolt , ElectricPotential . ParseUnit ( "\u00b5 V" ) ) ;
271
+ Assert . AreEqual ( FlowUnit . MicrolitersPerMinute , Flow . ParseUnit ( "\u00b5 LPM" ) ) ;
272
+ Assert . AreEqual ( ForceChangeRateUnit . MicronewtonPerSecond , ForceChangeRate . ParseUnit ( "\u00b5 N/s" ) ) ;
273
+ Assert . AreEqual ( ForcePerLengthUnit . MicronewtonPerMeter , ForcePerLength . ParseUnit ( "\u00b5 N/m" ) ) ;
274
+ Assert . AreEqual ( KinematicViscosityUnit . Microstokes , KinematicViscosity . ParseUnit ( "\u00b5 St" ) ) ;
275
+ Assert . AreEqual ( LengthUnit . Microinch , Length . ParseUnit ( "\u00b5 in" ) ) ;
276
+ Assert . AreEqual ( LengthUnit . Micrometer , Length . ParseUnit ( "\u00b5 m" ) ) ;
277
+ Assert . AreEqual ( MassFlowUnit . MicrogramPerSecond , MassFlow . ParseUnit ( "\u00b5 g/S" ) ) ;
278
+ Assert . AreEqual ( MassUnit . Microgram , Mass . ParseUnit ( "\u00b5 g" ) ) ;
279
+ Assert . AreEqual ( PowerUnit . Microwatt , Power . ParseUnit ( "\u00b5 W" ) ) ;
280
+ Assert . AreEqual ( PressureUnit . Micropascal , Pressure . ParseUnit ( "\u00b5 Pa" ) ) ;
281
+ Assert . AreEqual ( RotationalSpeedUnit . MicrodegreePerSecond , RotationalSpeed . ParseUnit ( "\u00b5 °/s" ) ) ;
282
+ Assert . AreEqual ( RotationalSpeedUnit . MicroradianPerSecond , RotationalSpeed . ParseUnit ( "\u00b5 rad/s" ) ) ;
283
+ Assert . AreEqual ( SpeedUnit . MicrometerPerMinute , Speed . ParseUnit ( "\u00b5 m/min" ) ) ;
284
+ Assert . AreEqual ( SpeedUnit . MicrometerPerSecond , Speed . ParseUnit ( "\u00b5 m/s" ) ) ;
285
+ Assert . AreEqual ( TemperatureChangeRateUnit . MicrodegreeCelsiusPerSecond , TemperatureChangeRate . ParseUnit ( "\u00b5 °C/s" ) ) ;
286
+ Assert . AreEqual ( VolumeUnit . Microliter , Volume . ParseUnit ( "\u00b5 l" ) ) ;
287
+ Assert . AreEqual ( VolumeUnit . CubicMicrometer , Volume . ParseUnit ( "\u00b5 m³" ) ) ;
288
+
289
+ // "\u03bc" = Lower case greek letter 'Mu'
290
+ Assert . Throws < UnitsNetException > ( ( ) => Acceleration . ParseUnit ( "\u03bc m/s²" ) ) ;
291
+ Assert . Throws < UnitsNetException > ( ( ) => AmplitudeRatio . ParseUnit ( "dB\u03bc V" ) ) ;
292
+ Assert . Throws < UnitsNetException > ( ( ) => Angle . ParseUnit ( "\u03bc °" ) ) ;
293
+ Assert . Throws < UnitsNetException > ( ( ) => Angle . ParseUnit ( "\u03bc rad" ) ) ;
294
+ Assert . Throws < UnitsNetException > ( ( ) => Area . ParseUnit ( "\u03bc m²" ) ) ;
295
+ Assert . Throws < UnitsNetException > ( ( ) => Duration . ParseUnit ( "\u03bc s" ) ) ;
296
+ Assert . Throws < UnitsNetException > ( ( ) => ElectricCurrent . ParseUnit ( "\u03bc A" ) ) ;
297
+ Assert . Throws < UnitsNetException > ( ( ) => ElectricPotential . ParseUnit ( "\u03bc V" ) ) ;
298
+ Assert . Throws < UnitsNetException > ( ( ) => Flow . ParseUnit ( "\u03bc LPM" ) ) ;
299
+ Assert . Throws < UnitsNetException > ( ( ) => ForceChangeRate . ParseUnit ( "\u03bc N/s" ) ) ;
300
+ Assert . Throws < UnitsNetException > ( ( ) => ForcePerLength . ParseUnit ( "\u03bc N/m" ) ) ;
301
+ Assert . Throws < UnitsNetException > ( ( ) => KinematicViscosity . ParseUnit ( "\u03bc St" ) ) ;
302
+ Assert . Throws < UnitsNetException > ( ( ) => Length . ParseUnit ( "\u03bc in" ) ) ;
303
+ Assert . Throws < UnitsNetException > ( ( ) => Length . ParseUnit ( "\u03bc m" ) ) ;
304
+ Assert . Throws < UnitsNetException > ( ( ) => MassFlow . ParseUnit ( "\u03bc g/S" ) ) ;
305
+ Assert . Throws < UnitsNetException > ( ( ) => Mass . ParseUnit ( "\u03bc g" ) ) ;
306
+ Assert . Throws < UnitsNetException > ( ( ) => Power . ParseUnit ( "\u03bc W" ) ) ;
307
+ Assert . Throws < UnitsNetException > ( ( ) => Pressure . ParseUnit ( "\u03bc Pa" ) ) ;
308
+ Assert . Throws < UnitsNetException > ( ( ) => RotationalSpeed . ParseUnit ( "\u03bc °/s" ) ) ;
309
+ Assert . Throws < UnitsNetException > ( ( ) => RotationalSpeed . ParseUnit ( "\u03bc rad/s" ) ) ;
310
+ Assert . Throws < UnitsNetException > ( ( ) => Speed . ParseUnit ( "\u03bc m/min" ) ) ;
311
+ Assert . Throws < UnitsNetException > ( ( ) => Speed . ParseUnit ( "\u03bc m/s" ) ) ;
312
+ Assert . Throws < UnitsNetException > ( ( ) => TemperatureChangeRate . ParseUnit ( "\u03bc °C/s" ) ) ;
313
+ Assert . Throws < UnitsNetException > ( ( ) => Volume . ParseUnit ( "\u03bc l" ) ) ;
314
+ Assert . Throws < UnitsNetException > ( ( ) => Volume . ParseUnit ( "\u03bc m³" ) ) ;
315
+ }
316
+
259
317
[ Test ]
260
318
public void AllUnitAbbreviationsImplemented ( [ Values ( "en-US" , "nb-NO" , "ru-RU" ) ] string cultureName )
261
319
{
0 commit comments