File tree Expand file tree Collapse file tree 4 files changed +40
-24
lines changed Expand file tree Collapse file tree 4 files changed +40
-24
lines changed Original file line number Diff line number Diff line change @@ -92,17 +92,21 @@ public void Constructor_UnitSystemSI_AssignsSIUnit()
92
92
}
93
93
94
94
[ Fact ]
95
- public void As_ImperialGivenSIUnitSystem_ReturnsSIValue ( )
95
+ public void As_GivenSIUnitSystem_ReturnsSIValue ( )
96
96
{
97
- var imperialArea = new Area ( 2.0 , AreaUnit . SquareInch ) ;
98
- Assert . Equal ( 0.00129032 , imperialArea . As ( UnitSystem . SI ) ) ;
97
+ var squareInches = new Area ( 2.0 , AreaUnit . SquareInch ) ;
98
+ Assert . Equal ( 0.00129032 , squareInches . As ( UnitSystem . SI ) ) ;
99
99
}
100
100
101
101
[ Fact ]
102
- public void ToUnit_ImperialGivenSIUnitSystem_ReturnsSIValue ( )
102
+ public void ToUnit_GivenSIUnitSystem_ReturnsSIQuantity ( )
103
103
{
104
- var imperialArea = new Area ( 2.0 , AreaUnit . SquareInch ) ;
105
- Assert . Equal ( Area . FromSquareMeters ( 0.00129032 ) , imperialArea . ToUnit ( UnitSystem . SI ) ) ;
104
+ var squareInches = new Area ( 2.0 , AreaUnit . SquareInch ) ;
105
+
106
+ var inSI = squareInches . ToUnit ( UnitSystem . SI ) ;
107
+
108
+ Assert . Equal ( 0.00129032 , inSI . Value ) ;
109
+ Assert . Equal ( AreaUnit . SquareMeter , inSI . Unit ) ;
106
110
}
107
111
}
108
112
}
Original file line number Diff line number Diff line change @@ -62,17 +62,21 @@ public void Constructor_UnitSystemSI_AssignsSIUnit()
62
62
}
63
63
64
64
[ Fact ]
65
- public void As_ImperialQuantityGivenSIUnitSystem_ReturnsSIValue ( )
65
+ public void As_GivenSIUnitSystem_ReturnsSIValue ( )
66
66
{
67
- var imperialEnergy = new Energy ( 2.0 , EnergyUnit . BritishThermalUnit ) ;
68
- Assert . Equal ( 2110.11170524 , imperialEnergy . As ( UnitSystem . SI ) ) ;
67
+ var btus = new Energy ( 2.0 , EnergyUnit . BritishThermalUnit ) ;
68
+ Assert . Equal ( 2110.11170524 , btus . As ( UnitSystem . SI ) ) ;
69
69
}
70
70
71
71
[ Fact ]
72
- public void ToUnit_ImperialQuantityGivenSIUnitSystem_ReturnsSIValue ( )
72
+ public void ToUnit_GivenSIUnitSystem_ReturnsSIQuantity ( )
73
73
{
74
- var imperialEnergy = new Energy ( 2.0 , EnergyUnit . BritishThermalUnit ) ;
75
- Assert . Equal ( Energy . FromJoules ( 2110.11170524 ) , imperialEnergy . ToUnit ( UnitSystem . SI ) ) ;
74
+ var btus = new Energy ( 2.0 , EnergyUnit . BritishThermalUnit ) ;
75
+
76
+ var inSI = btus . ToUnit ( UnitSystem . SI ) ;
77
+
78
+ Assert . Equal ( 2110.11170524 , inSI . Value ) ;
79
+ Assert . Equal ( EnergyUnit . Joule , inSI . Unit ) ;
76
80
}
77
81
}
78
82
}
Original file line number Diff line number Diff line change @@ -167,17 +167,21 @@ public void Constructor_UnitSystemSI_AssignsSIUnit()
167
167
}
168
168
169
169
[ Fact ]
170
- public void As_ImperialQuantityGivenSIUnitSystem_ReturnsSIValue ( )
170
+ public void As_GivenSIUnitSystem_ReturnsSIValue ( )
171
171
{
172
- var imperialLength = new Length ( 2.0 , LengthUnit . Inch ) ;
173
- Assert . Equal ( 0.0508 , imperialLength . As ( UnitSystem . SI ) ) ;
172
+ var inches = new Length ( 2.0 , LengthUnit . Inch ) ;
173
+ Assert . Equal ( 0.0508 , inches . As ( UnitSystem . SI ) ) ;
174
174
}
175
175
176
176
[ Fact ]
177
- public void ToUnit_ImperialQuantityGivenSIUnitSystem_ReturnsSIValue ( )
177
+ public void ToUnit_GivenSIUnitSystem_ReturnsSIQuantity ( )
178
178
{
179
- var imperialLength = new Length ( 2.0 , LengthUnit . Inch ) ;
180
- Assert . Equal ( Length . FromMeters ( 0.0508 ) , imperialLength . ToUnit ( UnitSystem . SI ) ) ;
179
+ var inches = new Length ( 2.0 , LengthUnit . Inch ) ;
180
+
181
+ var inSI = inches . ToUnit ( UnitSystem . SI ) ;
182
+
183
+ Assert . Equal ( 0.0508 , inSI . Value ) ;
184
+ Assert . Equal ( LengthUnit . Meter , inSI . Unit ) ;
181
185
}
182
186
}
183
187
}
Original file line number Diff line number Diff line change @@ -24,10 +24,10 @@ public void As_GivenNullUnitSystem_ThrowsArgumentNullException()
24
24
}
25
25
26
26
[ Fact ]
27
- public void As_ImperialQuantityGivenSIUnitSystem_ReturnsSIValue ( )
27
+ public void As_GivenSIUnitSystem_ReturnsSIValue ( )
28
28
{
29
- IQuantity imperialLengthQuantity = new Length ( 2.0 , LengthUnit . Inch ) ;
30
- Assert . Equal ( 0.0508 , imperialLengthQuantity . As ( UnitSystem . SI ) ) ;
29
+ IQuantity inches = new Length ( 2.0 , LengthUnit . Inch ) ;
30
+ Assert . Equal ( 0.0508 , inches . As ( UnitSystem . SI ) ) ;
31
31
}
32
32
33
33
[ Fact ]
@@ -45,10 +45,14 @@ public void ToUnit_GivenNullUnitSystem_ThrowsArgumentNullException()
45
45
}
46
46
47
47
[ Fact ]
48
- public void ToUnit_ImperialQuantityGivenSIUnitSystem_ReturnsSIValue ( )
48
+ public void ToUnit_GivenSIUnitSystem_ReturnsSIQuantity ( )
49
49
{
50
- IQuantity imperialLengthQuantity = new Length ( 2.0 , LengthUnit . Inch ) ;
51
- Assert . Equal ( Length . FromMeters ( 0.0508 ) , imperialLengthQuantity . ToUnit ( UnitSystem . SI ) ) ;
50
+ IQuantity inches = new Length ( 2.0 , LengthUnit . Inch ) ;
51
+
52
+ IQuantity inSI = inches . ToUnit ( UnitSystem . SI ) ;
53
+
54
+ Assert . Equal ( 0.0508 , inSI . Value ) ;
55
+ Assert . Equal ( LengthUnit . Meter , inSI . Unit ) ;
52
56
}
53
57
}
54
58
}
You can’t perform that action at this time.
0 commit comments