<?php
class PangramTest extends \PHPUnit_Framework_TestCase {
/** @test */
public function it_should_return_not_pangram_for_an_empty_string() {
$this->assertEquals('not pangram', isPangram(''));
}
/** @test */
public function it_should_return_not_pangram_for_an_string_lower_than_26() {
$this->assertEquals('not pangram', isPangram('a'));
}
/** @test */
public function it_should_return_not_pangram_for_an_string_which_doesnt_contain_letter_a() {
$this->assertEquals('not pangram', isPangram(str_repeat('b', 26)));
}
/** @test */
public function it_should_return_not_panagram_for_an_string_which_doesnt_contain_letter_b() {
$this->assertEquals('not panagram', isPanagram(str_repeat('a', 26)));
}
/** @test */
public function it_should_return_not_pangram_for_an_string_which_doesnt_contain_letter_c() {
$this->assertEquals('not pangram', isPangram(str_repeat('b', 26)));
}
}
function isPangram() {
return 'not pangram';
}
/** @test */
public function it_should_return_pangram_for_an_string_which_contains_all_the_letters_in_the_alphabet() {
$this->assertEquals('pangram', isPangram('The quick brown fox jumps over the lazy dog'));}
Basically what you are doing is reducing the problem to simpler subproblems which is a great thing and this thinking is mostly done before jumping to coding either via pen paper or whiteboard but I can't see the role of TDD in it.
--
The only way to go fast is to go well.
---
You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discu...@googlegroups.com.
To post to this group, send email to clean-code...@googlegroups.com.
Visit this group at https://groups.google.com/group/clean-code-discussion.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discussion+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discu...@googlegroups.com.
To post to this group, send email to clean-code...@googlegroups.com.
Visit this group at https://groups.google.com/group/clean-code-discussion.
--
The only way to go fast is to go well.
---
You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discu...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discussion+unsub...@googlegroups.com.
To post to this group, send email to clean-code...@googlegroups.com.
Visit this group at https://groups.google.com/group/clean-code-discussion.
--
The only way to go fast is to go well.
---
You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discussion+unsub...@googlegroups.com.
+1 for using alphabet array.
@sebastian we would like to see some example :)
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discu...@googlegroups.com.
To post to this group, send email to clean-code...@googlegroups.com.
Visit this group at https://groups.google.com/group/clean-code-discussion.
--
The only way to go fast is to go well.
---
You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discu...@googlegroups.com.
To post to this group, send email to clean-code...@googlegroups.com.
Visit this group at https://groups.google.com/group/clean-code-discussion.
--
The only way to go fast is to go well.
---
You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discu...@googlegroups.com.