diff --git a/lib/properties/volume.dart b/lib/properties/volume.dart index 3105872..f94914d 100644 --- a/lib/properties/volume.dart +++ b/lib/properties/volume.dart @@ -14,6 +14,7 @@ enum VOLUME { usPints, milliliters, tablespoonsUs, + teaspoonsUs, australianTablespoons, cups, cubicCentimeters, @@ -57,6 +58,7 @@ class Volume extends DoubleProperty { VOLUME.usPints: 'US pt', VOLUME.milliliters: 'ml', VOLUME.tablespoonsUs: 'tbsp.', + VOLUME.teaspoonsUs: 'tsp.', VOLUME.australianTablespoons: 'tbsp.', VOLUME.cups: 'cup', VOLUME.cubicCentimeters: 'cm³', @@ -134,6 +136,10 @@ class Volume extends DoubleProperty { coefficientProduct: 14.8, name: VOLUME.tablespoonsUs, ), + ConversionNode( + coefficientProduct: 4.92892, + name: VOLUME.teaspoonsUs, + ), ConversionNode( coefficientProduct: 20.0, name: VOLUME.australianTablespoons, @@ -198,6 +204,7 @@ class Volume extends DoubleProperty { Unit get usPints => getUnit(VOLUME.usPints); Unit get milliliters => getUnit(VOLUME.milliliters); Unit get tablespoonsUs => getUnit(VOLUME.tablespoonsUs); + Unit get teaspoonsUs => getUnit(VOLUME.teaspoonsUs); Unit get australianTablespoons => getUnit(VOLUME.australianTablespoons); Unit get cups => getUnit(VOLUME.cups); Unit get cubicCentimeters => getUnit(VOLUME.cubicCentimeters); diff --git a/test/conversion_test.dart b/test/conversion_test.dart index b6bb885..3f80c2e 100644 --- a/test/conversion_test.dart +++ b/test/conversion_test.dart @@ -481,6 +481,7 @@ void main() { VOLUME.usPints: 2113.3764188652, VOLUME.milliliters: 1e6, VOLUME.tablespoonsUs: 67567.567567568, + VOLUME.teaspoonsUs: 202884.20181297325, VOLUME.australianTablespoons: 50000, VOLUME.cups: 4166.6666666667, VOLUME.cubicCentimeters: 1e6, diff --git a/test/getters_test.dart b/test/getters_test.dart index 5cc3fce..b8e4cc4 100644 --- a/test/getters_test.dart +++ b/test/getters_test.dart @@ -489,6 +489,7 @@ void main() { runGetterTest(property.milliliters, property.getUnit(VOLUME.milliliters)); runGetterTest( property.tablespoonsUs, property.getUnit(VOLUME.tablespoonsUs)); + runGetterTest(property.teaspoonsUs, property.getUnit(VOLUME.teaspoonsUs)); runGetterTest(property.australianTablespoons, property.getUnit(VOLUME.australianTablespoons)); runGetterTest(property.cups, property.getUnit(VOLUME.cups));