Exemplo n.º 1
0
 public function testRatioAndGuarantee()
 {
     $claims = $this->prophesize('asylgrp\\workbench\\Domain\\ClaimArray');
     $claims->getHash()->willReturn('hash');
     $claims = $claims->reveal();
     $fundsPre = new SEK('100');
     $fundPost = new SEK('50');
     $ratio = new SEK('.1');
     $guarantee = new SEK('1000');
     $allocator = $this->prophesize('asylgrp\\workbench\\Domain\\Allocator\\Allocator');
     $allocator->allocate($claims, $fundsPre)->willReturn($fundPost);
     $ratioAllocator = $this->prophesize('asylgrp\\workbench\\Domain\\Allocator\\RatioAllocator');
     $ratioAllocator->getRatio()->willReturn($ratio);
     $guaranteeAllocator = $this->prophesize('asylgrp\\workbench\\Domain\\Allocator\\GuaranteeAllocator');
     $guaranteeAllocator->getGuarantee()->willReturn($guarantee);
     $factory = new DecisionFactory($allocator->reveal(), $ratioAllocator->reveal(), $guaranteeAllocator->reveal());
     $factory->setClaims($claims);
     $factory->setFunds($fundsPre);
     $decision = $factory->getDecision();
     $this->assertSame($ratio, $decision->getRatio());
     $this->assertSame($guarantee, $decision->getGuarantee());
 }