Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
prolic committed Jun 24, 2017
1 parent 21b94e0 commit d7777b5
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/Projection/AbstractProjectionManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,4 +307,34 @@ public function it_fetches_projection_state(): void

$this->assertSame([], $this->projectionManager->fetchProjectionState('test-projection'));
}

/**
* @test
*/
public function it_throws_exception_when_trying_to_delete_non_existing_projection(): void
{
$this->expectException(ProjectionNotFound::class);

$this->projectionManager->deleteProjection('unknown', false);
}

/**
* @test
*/
public function it_throws_exception_when_trying_to_reset_non_existing_projection(): void
{
$this->expectException(ProjectionNotFound::class);

$this->projectionManager->resetProjection('unknown');
}

/**
* @test
*/
public function it_throws_exception_when_trying_to_stop_non_existing_projection(): void
{
$this->expectException(ProjectionNotFound::class);

$this->projectionManager->stopProjection('unknown');
}
}
24 changes: 24 additions & 0 deletions tests/Projection/InMemoryProjectionManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,28 @@ public function it_cannot_stop_projections(): void

$this->projectionManager->stopProjection('foo');
}

/**
* @test
*/
public function it_throws_exception_when_trying_to_delete_non_existing_projection(): void
{
$this->markTestSkipped('Deleting a projection is not supported in ' . InMemoryProjectionManager::class);
}

/**
* @test
*/
public function it_throws_exception_when_trying_to_reset_non_existing_projection(): void
{
$this->markTestSkipped('Resetting a projection is not supported in ' . InMemoryProjectionManager::class);
}

/**
* @test
*/
public function it_throws_exception_when_trying_to_stop_non_existing_projection(): void
{
$this->markTestSkipped('Stopping a projection is not supported in ' . InMemoryProjectionManager::class);
}
}

0 comments on commit d7777b5

Please sign in to comment.