Skip to content

Commit 1edfef9

Browse files
adelmoralangularsen
authored andcommitted
Add VolumePerLength (#604)
* Add base units except for OilBarrelPerFoot I have no idea what base unit to put for that.
1 parent be555f9 commit 1edfef9

File tree

12 files changed

+1656
-0
lines changed

12 files changed

+1656
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"Name": "VolumePerLength",
3+
"BaseUnit": "CubicMeterPerMeter",
4+
"XmlDoc": "Volume, typically of fluid, that a container can hold within a unit of length.",
5+
"BaseDimensions": {
6+
"L": 3
7+
},
8+
"Units": [
9+
{
10+
"SingularName": "CubicMeterPerMeter",
11+
"PluralName": "CubicMetersPerMeter",
12+
"BaseUnits": {
13+
"L": "Meter"
14+
},
15+
"FromUnitToBaseFunc": "x",
16+
"FromBaseToUnitFunc": "x",
17+
"Prefixes": [],
18+
"Localization": [
19+
{
20+
"Culture": "en-US",
21+
"Abbreviations": [ "m³/m" ]
22+
}
23+
]
24+
},
25+
{
26+
"SingularName": "LiterPerMeter",
27+
"PluralName": "LitersPerMeter",
28+
"BaseUnits": {
29+
"L": "Decimeter"
30+
},
31+
"FromUnitToBaseFunc": "x/1000",
32+
"FromBaseToUnitFunc": "x*1000",
33+
"Prefixes": [],
34+
"Localization": [
35+
{
36+
"Culture": "en-US",
37+
"Abbreviations": [ "l/m" ]
38+
}
39+
]
40+
},
41+
{
42+
"SingularName": "OilBarrelPerFoot",
43+
"PluralName": "OilBarrelsPerFoot",
44+
"FromUnitToBaseFunc": "x/1.91713408",
45+
"FromBaseToUnitFunc": "x*1.91713408",
46+
"Prefixes": [],
47+
"Localization": [
48+
{
49+
"Culture": "en-US",
50+
"Abbreviations": [ "bbl/ft" ]
51+
}
52+
]
53+
}
54+
]
55+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated (once) by \generate-code.bat, but will not be
4+
// regenerated when it already exists. The purpose of creating this file is to make
5+
// it easier to remember to implement all the unit conversion test cases.
6+
//
7+
// Whenever a new unit is added to this quantity and \generate-code.bat is run,
8+
// the base test class will get a new abstract property and cause a compile error
9+
// in this derived class, reminding the developer to implement the test case
10+
// for the new unit.
11+
//
12+
// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
13+
//
14+
// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
15+
// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
16+
//
17+
// </auto-generated>
18+
//------------------------------------------------------------------------------
19+
20+
// Licensed under MIT No Attribution, see LICENSE file at the root.
21+
// Copyright 2013 Andreas Gullberg Larsen ([email protected]). Maintained at https://github.com/angularsen/UnitsNet.
22+
23+
using System;
24+
25+
namespace UnitsNet.Tests.CustomCode
26+
{
27+
public class VolumePerLengthTests : VolumePerLengthTestsBase
28+
{
29+
// Override properties in base class here
30+
protected override double CubicMetersPerMeterInOneCubicMeterPerMeter => 1;
31+
32+
protected override double LitersPerMeterInOneCubicMeterPerMeter => 1000;
33+
34+
protected override double OilBarrelsPerFootInOneCubicMeterPerMeter => 1.917134088;
35+
}
36+
}

0 commit comments

Comments
 (0)