Completed
Push — master ( 67ee93...84505b )
by Ivannis Suárez
07:55
created

AggregateRepositoryFactoryTests::testCreate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 0
1
<?php
2
3
/**
4
 * This file is part of the Cubiche/EventSourcing component.
5
 *
6
 * Copyright (c) Cubiche
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Cubiche\Domain\EventSourcing\Tests\Units\Factory;
13
14
use Cubiche\Domain\EventSourcing\AggregateRepository;
15
use Cubiche\Domain\EventSourcing\EventStore\InMemoryEventStore;
16
use Cubiche\Domain\EventSourcing\Factory\AggregateRepositoryFactory;
17
use Cubiche\Domain\EventSourcing\Tests\Fixtures\PostEventSourced;
18
use Cubiche\Domain\EventSourcing\Tests\Units\TestCase;
19
20
/**
21
 * AggregateRepositoryFactoryTests class.
22
 *
23
 * Generated by TestGenerator on 2016-06-28 at 14:36:54.
24
 */
25
class AggregateRepositoryFactoryTests extends TestCase
26
{
27
    /**
28
     * @return AggregateRepositoryFactory
29
     */
30
    protected function createFactory()
31
    {
32
        return new AggregateRepositoryFactory(new InMemoryEventStore());
33
    }
34
35
    /**
36
     * Test create.
37
     */
38
    public function testCreate()
39
    {
40
        $this
41
            ->given($factory = $this->createFactory())
42
            ->and($repository = $factory->create(PostEventSourced::class))
43
            ->then()
44
                ->object($repository)
45
                    ->isInstanceOf(AggregateRepository::class)
46
                ->and()
47
                ->string($this->invoke($repository)->streamName())
48
                    ->isEqualTo('post_event_sourced')
49
        ;
50
    }
51
}
52