Skip to content

Commit

Permalink
unit test for start and end price
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul van Kaam committed Nov 4, 2020
1 parent 7f80902 commit be06599
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/Parser/Banking/Mt940/Engine/Knab/ParseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,29 @@ public function testStructuredMt940() {
$this->assertEquals('ACHMEA SCHADEVERZEKERINGEN N.V.', $structuredTransaction->getAccountName());
$this->assertEquals('EERSTE MAAND, MAART VERZEKERING 5002100023 310160', $structuredTransaction->getDescription());
}


public function testStartPrice() {
$this->engine->loadString(file_get_contents(__DIR__.'/sample'));
$statements = $this->engine->parse();
$start_price_m = $statements[0]->getStartPrice();
$this->assertSame(1000.21 , $start_price_m);

$this->engine->loadString(file_get_contents(__DIR__.'/sample2'));
$statements = $this->engine->parse();
$start_price_f = $statements[0]->getStartPrice();
$this->assertSame(12490.07 , $start_price_f);
}

public function testEndPrice() {
$this->engine->loadString(file_get_contents(__DIR__.'/sample'));
$statements = $this->engine->parse();
$price_m = $statements[0]->getEndPrice();
$this->assertSame(945.21 , $price_m);

$this->engine->loadString(file_get_contents(__DIR__.'/sample2'));
$statements = $this->engine->parse();
$price_f = $statements[0]->getEndPrice();
$this->assertSame(13057.49 , $price_f);
}
}
10 changes: 10 additions & 0 deletions test/Parser/Banking/Mt940/Engine/Knab/sample2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{1:F01KNABNL2HAXXX0000000000}{2:I940KNABNL2HXXXXN3020}{4:
:20:C0D28MSTE73HKBCM
:25:NL52RABO0326203011
:28C:108/1
:60F:C200427EUR12490,07
:61:2004270427C567,42N110NONREF//C0D27XM01D000031
:86:/TRTP/OVERBOEKING/IBAN/123/BIC/SXPYDEHHXX
X/NAME/STRIPE PAYMENTS UK LTD/REMI/SHOPIFY D3DJ2
:62F:C200428EUR13057,49
-}

0 comments on commit be06599

Please sign in to comment.