1
- //------------------------------------------------------------------------------
2
- // <auto-generated>
3
- // This code was generated (once) by \generate-code.bat, but will not be
4
- // regenerated when it already exists. The purpose of creating this file is to make
5
- // it easier to remember to implement all the unit conversion test cases.
6
- //
7
- // Whenever a new unit is added to this quantity and \generate-code.bat is run,
8
- // the base test class will get a new abstract property and cause a compile error
9
- // in this derived class, reminding the developer to implement the test case
10
- // for the new unit.
11
- //
12
- // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
13
- //
14
- // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
15
- // Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities.
16
- //
17
- // </auto-generated>
18
- //------------------------------------------------------------------------------
19
-
20
- // Licensed under MIT No Attribution, see LICENSE file at the root.
1
+ // Licensed under MIT No Attribution, see LICENSE file at the root.
21
2
// Copyright 2013 Andreas Gullberg Larsen ([email protected] ). Maintained at https://github.com/angularsen/UnitsNet.
22
3
23
-
24
- using System ;
4
+ using Xunit ;
25
5
26
6
namespace UnitsNet . Tests . CustomCode
27
7
{
@@ -32,5 +12,19 @@ public class ElectricChargeTests : ElectricChargeTestsBase
32
12
protected override double AmpereHoursInOneCoulomb => 2.77777777777e-4 ;
33
13
protected override double KiloampereHoursInOneCoulomb => 2.77777777777e-7 ;
34
14
protected override double MegaampereHoursInOneCoulomb => 2.77777777777e-10 ;
15
+
16
+ [ Fact ]
17
+ public void ElectricChargeDividedByElectricCurrentEqualsDuration ( )
18
+ {
19
+ Duration t = ElectricCharge . FromAmpereHours ( 20 ) / ElectricCurrent . FromAmperes ( 5 ) ;
20
+ Assert . Equal ( 4 , t . Hours ) ;
21
+ }
22
+
23
+ [ Fact ]
24
+ public void ElectricChargeDividedByDurationEqualsElectricCurrent ( )
25
+ {
26
+ ElectricCurrent i = ElectricCharge . FromAmpereHours ( 20 ) / Duration . FromHours ( 4 ) ;
27
+ Assert . Equal ( 5 , i . Amperes ) ;
28
+ }
35
29
}
36
30
}
0 commit comments