Skip to content

Commit 2add629

Browse files
authored
Removing the Dimensions instance property (v6) (#1612)
Related to #1610
1 parent 87e5d7c commit 2add629

File tree

134 files changed

+1
-839
lines changed

Some content is hidden

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

134 files changed

+1
-839
lines changed

CodeGen/Generators/UnitsNetGen/IQuantityTestClassGenerator.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,6 @@ public void QuantityInfo_IsSameAsStaticInfoProperty()
6161
Assertion({quantity.Name}.Info, {quantity.Name}.Zero);");
6262
Writer.WL($@"
6363
}}
64-
65-
[Fact]
66-
public void Dimensions_IsSameAsStaticBaseDimensions()
67-
{{
68-
void Assertion(BaseDimensions expected, IQuantity quantity) => Assert.Equal(expected, quantity.Dimensions);
69-
");
70-
foreach (var quantity in _quantities) Writer.WL($@"
71-
Assertion({quantity.Name}.BaseDimensions, {quantity.Name}.Zero);");
72-
Writer.WL($@"
73-
}}
7464
}}
7565
}}");
7666

CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,6 @@ private void GenerateProperties()
374374
/// <inheritdoc />
375375
public QuantityInfo<{_quantity.Name}, {_unitEnumName}> QuantityInfo => Info;
376376
377-
/// <summary>
378-
/// The <see cref=""BaseDimensions"" /> of this quantity.
379-
/// </summary>
380-
public BaseDimensions Dimensions => {_quantity.Name}.BaseDimensions;
381-
382377
#region Explicit implementations
383378
384379
[DebuggerBrowsable(DebuggerBrowsableState.Never)]

UnitsNet.Tests/BaseDimensionsTests.cs

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -421,33 +421,13 @@ public void CheckBaseDimensionDivisionWithSpeedEqualsDistanceDividedByTimeOnStat
421421
Assert.True(calculatedDimensions == Speed.BaseDimensions);
422422
}
423423

424-
[Fact]
425-
public void CheckBaseDimensionDivisionWithSpeedEqualsDistanceDividedByTimeOnInstanceProperty()
426-
{
427-
var length = Length.FromKilometers(100);
428-
var duration = Duration.FromHours(1);
429-
430-
BaseDimensions calculatedDimensions = length.Dimensions.Divide(duration.Dimensions);
431-
Assert.True(calculatedDimensions == Speed.BaseDimensions);
432-
}
433-
434424
[Fact]
435425
public void CheckBaseDimensionMultiplicationWithForceEqualsMassTimesAccelerationOnStaticProperty()
436426
{
437427
BaseDimensions calculatedDimensions = Mass.BaseDimensions.Multiply(Acceleration.BaseDimensions);
438428
Assert.True(calculatedDimensions == Force.BaseDimensions);
439429
}
440430

441-
[Fact]
442-
public void CheckBaseDimensionMultiplicationWithForceEqualsMassTimesAccelerationOnInstanceProperty()
443-
{
444-
var mass = Mass.FromPounds(205);
445-
var acceleration = Acceleration.FromMetersPerSecondSquared(9.8);
446-
447-
BaseDimensions calculatedDimensions = mass.Dimensions.Multiply(acceleration.Dimensions);
448-
Assert.True(calculatedDimensions == Force.BaseDimensions);
449-
}
450-
451431
[Fact]
452432
public void EqualityWorksAsExpectedWithOperatorOverloads()
453433
{
@@ -703,33 +683,13 @@ public void CheckBaseDimensionDivisionWithSpeedEqualsDistanceDividedByTimeOnStat
703683
Assert.True(calculatedDimensions == Speed.BaseDimensions);
704684
}
705685

706-
[Fact]
707-
public void CheckBaseDimensionDivisionWithSpeedEqualsDistanceDividedByTimeOnInstancePropertyWithOperatorOverloads()
708-
{
709-
var length = Length.FromKilometers(100);
710-
var duration = Duration.FromHours(1);
711-
712-
BaseDimensions calculatedDimensions = length.Dimensions / duration.Dimensions;
713-
Assert.True(calculatedDimensions == Speed.BaseDimensions);
714-
}
715-
716686
[Fact]
717687
public void CheckBaseDimensionMultiplicationWithForceEqualsMassTimesAccelerationOnStaticPropertyWithOperatorOverloads()
718688
{
719689
BaseDimensions calculatedDimensions = Mass.BaseDimensions * Acceleration.BaseDimensions;
720690
Assert.True(calculatedDimensions == Force.BaseDimensions);
721691
}
722692

723-
[Fact]
724-
public void CheckBaseDimensionMultiplicationWithForceEqualsMassTimesAccelerationOnInstancePropertyWithOperatorOverloads()
725-
{
726-
var mass = Mass.FromPounds(205);
727-
var acceleration = Acceleration.FromMetersPerSecondSquared(9.8);
728-
729-
BaseDimensions calculatedDimensions = mass.Dimensions * acceleration.Dimensions;
730-
Assert.True(calculatedDimensions == Force.BaseDimensions);
731-
}
732-
733693
[Fact]
734694
public void CheckToStringUsingMolarEntropy()
735695
{

UnitsNet.Tests/CustomQuantities/HowMuch.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ QuantityInfo IQuantity.QuantityInfo
5858
{
5959
get => Info;
6060
}
61-
62-
public BaseDimensions Dimensions => Info.BaseDimensions;
63-
64-
61+
6562
UnitKey IQuantity.UnitKey
6663
{
6764
get => UnitKey.ForUnit(Unit);

UnitsNet.Tests/GeneratedCode/IQuantityTests.g.cs

Lines changed: 0 additions & 135 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/Angle.g.cs

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)