Additional Unit Test Cases for Convert UoM (#1864)

* Additional Unit Test Cases
This commit is contained in:
Mark Baker 2021-02-19 08:41:26 +01:00 committed by GitHub
parent b269c26f6e
commit 409c05b542
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 51 additions and 3 deletions

View File

@ -37,6 +37,12 @@ class ConvertUoMTest extends TestCase
self::assertIsArray($result); self::assertIsArray($result);
} }
public function testGetBinaryConversionMultipliers(): void
{
$result = Engineering::getBinaryConversionMultipliers();
self::assertIsArray($result);
}
/** /**
* @dataProvider providerCONVERTUOM * @dataProvider providerCONVERTUOM
* *

View File

@ -139,6 +139,18 @@ return [
'K', 'K',
'Reau', '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)' => [ 'Temperature synonyms (K)' => [
123.45, 123.45,
123.45, 123.45,
@ -157,12 +169,18 @@ return [
'F', 'F',
'fah', 'fah',
], ],
'Invalid value to conver' => [ 'Invalid value to convert' => [
'#VALUE!', '#VALUE!',
'three', 'three',
'ft', 'ft',
'yds', 'yds',
], ],
'Imperial to 2-character prefixed imperial, same unit' => [
'#N/A',
100.0,
'pt',
'dapt',
],
'Prefixed metric to binary prefixed metric' => [ 'Prefixed metric to binary prefixed metric' => [
'#N/A', '#N/A',
12.345, 12.345,
@ -175,18 +193,42 @@ return [
'ft', 'ft',
'day', 'day',
], ],
'From Prefixed imperial (Invalid)' => [ 'From prefixed Imperial (Invalid)' => [
'#N/A', '#N/A',
234.56, 234.56,
'kpt', 'kpt',
'lt', 'lt',
], ],
'To prefixed imperial (Invalid)' => [ 'To prefixed Imperial (Invalid)' => [
'#N/A', '#N/A',
234.56, 234.56,
'lt', 'lt',
'kpt', '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' => [ 'Invalid from unit' => [
'#N/A', '#N/A',
234.56, 234.56,