generated from spawnia/php-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDnaSequenceTest.php
41 lines (34 loc) · 1.11 KB
/
DnaSequenceTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php declare(strict_types=1);
namespace MLL\Utils\Tests;
use MLL\Utils\DnaSequence;
use PHPUnit\Framework\TestCase;
final class DnaSequenceTest extends TestCase
{
public function testReverse(): void
{
$dnaSequence = new DnaSequence('ATGC');
self::assertSame('CGTA', $dnaSequence->reverse());
}
public function testComplement(): void
{
$dnaSequence = new DnaSequence('ATGC');
self::assertSame('TACG', $dnaSequence->complement());
}
public function testReverseComplement(): void
{
$dnaSequence = new DnaSequence('ATGC');
self::assertSame('GCAT', $dnaSequence->reverseComplement());
}
public function testInvalidSequenceThrowsException(): void
{
$this->expectException(\InvalidArgumentException::class);
new DnaSequence('INVALID');
}
public function testEmptySequence(): void
{
$dnaSequence = new DnaSequence('');
self::assertSame('', $dnaSequence->reverse());
self::assertSame('', $dnaSequence->complement());
self::assertSame('', $dnaSequence->reverseComplement());
}
}