Skip to content

Commit

Permalink
add VOLUME.imperialQuarts (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksonlo authored Jan 21, 2024
1 parent 96e4c38 commit e32e1ca
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/properties/volume.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ enum VOLUME {
imperialGallons,
usGallons,
imperialPints,
imperialQuarts,
usPints,
milliliters,
tablespoonsUs,
Expand Down Expand Up @@ -52,6 +53,7 @@ class Volume extends DoubleProperty<VOLUME> {
VOLUME.imperialGallons: 'imp gal',
VOLUME.usGallons: 'US gal',
VOLUME.imperialPints: 'imp pt',
VOLUME.imperialQuarts: 'imp qt',
VOLUME.usPints: 'US pt',
VOLUME.milliliters: 'ml',
VOLUME.tablespoonsUs: 'tbsp.',
Expand Down Expand Up @@ -90,6 +92,10 @@ class Volume extends DoubleProperty<VOLUME> {
coefficientProduct: 0.56826125,
name: VOLUME.imperialPints,
children: [
ConversionNode(
coefficientProduct: 2,
name: VOLUME.imperialQuarts,
),
ConversionNode(
coefficientProduct: 1 / 20,
name: VOLUME.imperialFluidOunces,
Expand Down Expand Up @@ -188,6 +194,7 @@ class Volume extends DoubleProperty<VOLUME> {
Unit get imperialGallons => getUnit(VOLUME.imperialGallons);
Unit get usGallons => getUnit(VOLUME.usGallons);
Unit get imperialPints => getUnit(VOLUME.imperialPints);
Unit get imperialQuarts => getUnit(VOLUME.imperialQuarts);
Unit get usPints => getUnit(VOLUME.usPints);
Unit get milliliters => getUnit(VOLUME.milliliters);
Unit get tablespoonsUs => getUnit(VOLUME.tablespoonsUs);
Expand Down
1 change: 1 addition & 0 deletions test/conversion_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ void main() {
VOLUME.imperialGallons: 219.96924829909,
VOLUME.usGallons: 264.17205235815,
VOLUME.imperialPints: 1759.7539863927,
VOLUME.imperialQuarts: 879.876993196,
VOLUME.usPints: 2113.3764188652,
VOLUME.milliliters: 1e6,
VOLUME.tablespoonsUs: 67567.567567568,
Expand Down
2 changes: 2 additions & 0 deletions test/getters_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,8 @@ void main() {
runGetterTest(property.usGallons, property.getUnit(VOLUME.usGallons));
runGetterTest(
property.imperialPints, property.getUnit(VOLUME.imperialPints));
runGetterTest(
property.imperialQuarts, property.getUnit(VOLUME.imperialQuarts));
runGetterTest(property.usPints, property.getUnit(VOLUME.usPints));
runGetterTest(property.milliliters, property.getUnit(VOLUME.milliliters));
runGetterTest(
Expand Down

0 comments on commit e32e1ca

Please sign in to comment.