Skip to content

Add VolumePerLength #604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 8, 2019
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
55 changes: 55 additions & 0 deletions Common/UnitDefinitions/VolumePerLength.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"Name": "VolumePerLength",
"BaseUnit": "CubicMeterPerMeter",
"XmlDoc": "Volume, typically of fluid, that a container can hold within a unit of length.",
"BaseDimensions": {
"L": 3
},
"Units": [
{
"SingularName": "CubicMeterPerMeter",
"PluralName": "CubicMetersPerMeter",
"BaseUnits": {
"L": "Meter"
},
"FromUnitToBaseFunc": "x",
"FromBaseToUnitFunc": "x",
"Prefixes": [],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "m³/m" ]
}
]
},
{
"SingularName": "LiterPerMeter",
"PluralName": "LitersPerMeter",
"BaseUnits": {
"L": "Decimeter"
},
"FromUnitToBaseFunc": "x/1000",
"FromBaseToUnitFunc": "x*1000",
"Prefixes": [],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "l/m" ]
}
]
},
{
"SingularName": "OilBarrelPerFoot",
"PluralName": "OilBarrelsPerFoot",
"FromUnitToBaseFunc": "x/1.91713408",
"FromBaseToUnitFunc": "x*1.91713408",
"Prefixes": [],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "bbl/ft" ]
}
]
}
]
}
36 changes: 36 additions & 0 deletions UnitsNet.Tests/CustomCode/VolumePerLengthTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated (once) by \generate-code.bat, but will not be
// regenerated when it already exists. The purpose of creating this file is to make
// it easier to remember to implement all the unit conversion test cases.
//
// Whenever a new unit is added to this quantity and \generate-code.bat is run,
// the base test class will get a new abstract property and cause a compile error
// in this derived class, reminding the developer to implement the test case
// for the new unit.
//
// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
//
// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
//
// </auto-generated>
//------------------------------------------------------------------------------

// Licensed under MIT No Attribution, see LICENSE file at the root.
// Copyright 2013 Andreas Gullberg Larsen ([email protected]). Maintained at https://github.com/angularsen/UnitsNet.

using System;

namespace UnitsNet.Tests.CustomCode
{
public class VolumePerLengthTests : VolumePerLengthTestsBase
{
// Override properties in base class here
protected override double CubicMetersPerMeterInOneCubicMeterPerMeter => 1;

protected override double LitersPerMeterInOneCubicMeterPerMeter => 1000;

protected override double OilBarrelsPerFootInOneCubicMeterPerMeter => 1.917134088;
}
}
Loading