Skip to content
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

Additional Unit Test Cases for Convert UoM #1864

Merged
merged 2 commits into from
Feb 19, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ public function testGetConversionMultipliers(): void
self::assertIsArray($result);
}

public function testGetBinaryConversionMultipliers(): void
{
$result = Engineering::getBinaryConversionMultipliers();
self::assertIsArray($result);
}

/**
* @dataProvider providerCONVERTUOM
*
Expand Down
48 changes: 45 additions & 3 deletions tests/data/Calculation/Engineering/CONVERTUOM.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@
'K',
'Reau',
],
'Melting Point of Titanium (Rankine to K)' => [
1941,
3493.8,
'Rank',
'K',
],
'Melting Point of Titanium (Réaumur to K)' => [
1941,
1334.28,
'Reau',
'K',
],
'Temperature synonyms (K)' => [
123.45,
123.45,
Expand All @@ -157,12 +169,18 @@
'F',
'fah',
],
'Invalid value to conver' => [
'Invalid value to convert' => [
'#VALUE!',
'three',
'ft',
'yds',
],
'Imperial to 2-character prefixed imperial, same unit' => [
'#N/A',
100.0,
'pt',
'dapt',
],
'Prefixed metric to binary prefixed metric' => [
'#N/A',
12.345,
Expand All @@ -175,18 +193,42 @@
'ft',
'day',
],
'From Prefixed imperial (Invalid)' => [
'From prefixed Imperial (Invalid)' => [
'#N/A',
234.56,
'kpt',
'lt',
],
'To prefixed imperial (Invalid)' => [
'To prefixed Imperial (Invalid)' => [
'#N/A',
234.56,
'lt',
'kpt',
],
'From binary prefixed Imperial (Invalid)' => [
'#N/A',
234.56,
'kiqt',
'pt',
],
'To binary prefixed Imperial (Invalid)' => [
'#N/A',
234.56,
'pt',
'kiqt',
],
'From prefixed Imperial 2 (Invalid)' => [
'#N/A',
12345.6,
'baton',
'cwt',
],
'To prefixed Imperial 2 (Invalid)' => [
'#N/A',
12345.6,
'cwt',
'baton',
],
'Invalid from unit' => [
'#N/A',
234.56,
Expand Down