Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Common/UnitDefinitions/MassFlow.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@
}
]
},
{
"SingularName": "GramPerHour",
"PluralName": "GramsPerHour",
"FromUnitToBaseFunc": "x/3600",
"FromBaseToUnitFunc": "x*3600",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "g/h" ]
}
]
},
{
"SingularName": "KilogramPerHour",
"PluralName": "KilogramsPerHour",
Expand Down Expand Up @@ -104,7 +116,7 @@
}
]
},
{
{
"SingularName": "PoundPerMinute",
"PluralName": "PoundsPerMinute",
"FromUnitToBaseFunc": "x/0.132277",
Expand Down
14 changes: 9 additions & 5 deletions UnitsNet.Tests/CustomCode/MassFlowTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ namespace UnitsNet.Tests.CustomCode
{
public class MassFlowTests : MassFlowTestsBase
{
/// <inheritdoc />
protected override double GramsPerSecondInOneGramPerSecond => 1;

protected override double DecagramsPerSecondInOneGramPerSecond => 1E-1;
Expand All @@ -52,7 +53,7 @@ public class MassFlowTests : MassFlowTestsBase

protected override double ShortTonsPerHourInOneGramPerSecond => 3.96832e-3;

protected override double TonnesPerDayInOneGramPerSecond => 60.0*60*24/1E6;
protected override double TonnesPerDayInOneGramPerSecond => 60.0 * 60 * 24 / 1E6;

protected override double PoundsPerHourInOneGramPerSecond => 7.93664;

Expand Down Expand Up @@ -86,31 +87,34 @@ public class MassFlowTests : MassFlowTestsBase

protected override double PoundsPerDayInOneGramPerSecond => 1.9047936e2;

protected override double GramsPerHourInOneGramPerSecond => 3600;


[Fact]
public void DurationTimesMassFlowEqualsMass()
{
Mass mass = Duration.FromSeconds(4.0)*MassFlow.FromKilogramsPerSecond(20.0);
Mass mass = Duration.FromSeconds(4.0) * MassFlow.FromKilogramsPerSecond(20.0);
Assert.Equal(mass, Mass.FromKilograms(80.0));
}

[Fact]
public void MassFlowTimesDurationEqualsMass()
{
Mass mass = MassFlow.FromKilogramsPerSecond(20.0)*Duration.FromSeconds(4.0);
Mass mass = MassFlow.FromKilogramsPerSecond(20.0) * Duration.FromSeconds(4.0);
Assert.Equal(mass, Mass.FromKilograms(80.0));
}

[Fact]
public void MassFlowTimesTimeSpanEqualsMass()
{
Mass mass = MassFlow.FromKilogramsPerSecond(20.0)*TimeSpan.FromSeconds(4.0);
Mass mass = MassFlow.FromKilogramsPerSecond(20.0) * TimeSpan.FromSeconds(4.0);
Assert.Equal(mass, Mass.FromKilograms(80.0));
}

[Fact]
public void TimeSpanTimesMassFlowEqualsMass()
{
Mass mass = TimeSpan.FromSeconds(4.0)*MassFlow.FromKilogramsPerSecond(20.0);
Mass mass = TimeSpan.FromSeconds(4.0) * MassFlow.FromKilogramsPerSecond(20.0);
Assert.Equal(mass, Mass.FromKilograms(80.0));
}

Expand Down
10 changes: 10 additions & 0 deletions UnitsNet.Tests/GeneratedCode/MassFlowTestsBase.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/UnitAbbreviationsCache.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Units/MassFlowUnit.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.