Skip to content

Commit e45efe8

Browse files
committed
removed SupportsSIUnitSystem in favor of the As_UnitSystem_ThrowsArgumentExceptionIfNotSupported tests
1 parent 9d5c86f commit e45efe8

File tree

120 files changed

+217
-260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+217
-260
lines changed

CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -154,21 +154,6 @@ public void Ctor_NullAsUnitSystem_ThrowsArgumentNullException()
154154
Assert.Throws<ArgumentNullException>(() => new {_quantity.Name}(value: 1, unitSystem: null));
155155
}}
156156
157-
[Fact]
158-
public void Ctor_SIUnitSystem_ThrowsArgumentExceptionIfNotSupported()
159-
{{
160-
Func<object> TestCode = () => new {_quantity.Name}(value: 1, unitSystem: UnitSystem.SI);
161-
if (SupportsSIUnitSystem)
162-
{{
163-
var quantity = ({_quantity.Name}) TestCode();
164-
Assert.Equal(1, quantity.Value);
165-
}}
166-
else
167-
{{
168-
Assert.Throws<ArgumentException>(TestCode);
169-
}}
170-
}}
171-
172157
[Fact]
173158
public void Ctor_UnitSystem_ThrowsArgumentExceptionIfNotSupported()
174159
{{");

UnitsNet.Tests/CustomCode/AccelerationTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ namespace UnitsNet.Tests.CustomCode
77
{
88
public class AccelerationTests : AccelerationTestsBase
99
{
10-
protected override bool SupportsSIUnitSystem => true;
11-
1210
protected override double KilometersPerSecondSquaredInOneMeterPerSecondSquared => 1E-3;
1311

1412
protected override double MetersPerSecondSquaredInOneMeterPerSecondSquared => 1;

UnitsNet.Tests/CustomCode/AmountOfSubstanceTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ namespace UnitsNet.Tests.CustomCode
2828
{
2929
public class AmountOfSubstanceTests : AmountOfSubstanceTestsBase
3030
{
31-
protected override bool SupportsSIUnitSystem => true;
32-
3331
protected override double CentimolesInOneMole => 1e2;
3432
protected override double CentipoundMolesInOneMole => 0.002204622621848776 * 1e2;
3533
protected override double DecimolesInOneMole => 1e1;

UnitsNet.Tests/CustomCode/AmplitudeRatioTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ namespace UnitsNet.Tests.CustomCode
88
{
99
public class AmplitudeRatioTests : AmplitudeRatioTestsBase
1010
{
11-
protected override bool SupportsSIUnitSystem => false;
1211
protected override double DecibelMicrovoltsInOneDecibelVolt => 121;
1312

1413
protected override double DecibelMillivoltsInOneDecibelVolt => 61;

UnitsNet.Tests/CustomCode/AngleTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ namespace UnitsNet.Tests.CustomCode
88
{
99
public class AngleTests : AngleTestsBase
1010
{
11-
protected override bool SupportsSIUnitSystem => false;
12-
1311
protected override double DegreesInOneDegree => 1;
1412

1513
protected override double GradiansInOneDegree => 400 / 360.0;

UnitsNet.Tests/CustomCode/ApparentEnergyTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ namespace UnitsNet.Tests.CustomCode
2727
{
2828
public class ApparentEnergyTests : ApparentEnergyTestsBase
2929
{
30-
protected override bool SupportsSIUnitSystem => false;
31-
3230
protected override double VoltampereHoursInOneVoltampereHour => 1;
3331

3432
protected override double KilovoltampereHoursInOneVoltampereHour => 1E-3;

UnitsNet.Tests/CustomCode/ApparentPowerTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ namespace UnitsNet.Tests.CustomCode
2727
{
2828
public class ApparentPowerTests : ApparentPowerTestsBase
2929
{
30-
protected override bool SupportsSIUnitSystem => false;
31-
3230
protected override double VoltamperesInOneVoltampere => 1;
3331

3432
protected override double KilovoltamperesInOneVoltampere => 1E-3;

UnitsNet.Tests/CustomCode/AreaDensityTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ namespace UnitsNet.Tests.CustomCode
2727
{
2828
public class AreaDensityTests : AreaDensityTestsBase
2929
{
30-
protected override bool SupportsSIUnitSystem => true;
31-
3230
protected override double KilogramsPerSquareMeterInOneKilogramPerSquareMeter => 1;
3331
}
3432
}

UnitsNet.Tests/CustomCode/AreaMomentOfInertiaTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ namespace UnitsNet.Tests.CustomCode
2828
{
2929
public class AreaMomentOfInertiaTests : AreaMomentOfInertiaTestsBase
3030
{
31-
protected override bool SupportsSIUnitSystem => true;
32-
3331
protected override double CentimetersToTheFourthInOneMeterToTheFourth => 1e8;
3432

3533
protected override double DecimetersToTheFourthInOneMeterToTheFourth => 1e4;

UnitsNet.Tests/CustomCode/AreaTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ namespace UnitsNet.Tests.CustomCode
88
{
99
public class AreaTests : AreaTestsBase
1010
{
11-
protected override bool SupportsSIUnitSystem => true;
12-
1311
protected override double SquareKilometersInOneSquareMeter => 1E-6;
1412

1513
protected override double SquareMetersInOneSquareMeter => 1;

0 commit comments

Comments
 (0)