Skip to content

Commit

Permalink
Added TemperatureChangeRate unit relation (#1371)
Browse files Browse the repository at this point in the history
Added unit relation to get TemperatureChangeRate from TemperatureDelta
divided by Duration.

---------

Co-authored-by: Andreas Gullberg Larsen <andreas.larsen84@gmail.com>
  • Loading branch information
Tim-Borcherding and angularsen authored Mar 1, 2024
1 parent 8f503e9 commit 5572dc2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions UnitsNet.Tests/CustomCode/TemperatureDeltaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,19 @@ public void TemperatureDeltaTimesEntropyEqualsEnergy()
Energy energy = TemperatureDelta.FromKelvins(20) * Entropy.FromJoulesPerKelvin(4);
Assert.Equal(Energy.FromJoules(80), energy);
}

[Fact]
public void TemperatureDeltaDividedByTimeSpanEqualsTemperatureChangeRate()
{
TemperatureChangeRate changeRate = TemperatureDelta.FromKelvins(20) / TimeSpan.FromSeconds(2);
Assert.Equal(TemperatureChangeRate.FromDegreesCelsiusPerSecond(10), changeRate);
}

[Fact]
public void TemperatureDeltaDividedByDurationEqualsTemperatureChangeRate()
{
TemperatureChangeRate changeRate = TemperatureDelta.FromKelvins(20) / Duration.FromSeconds(2);
Assert.Equal(TemperatureChangeRate.FromDegreesCelsiusPerSecond(10), changeRate);
}
}
}

0 comments on commit 5572dc2

Please sign in to comment.