123456789101112131415161718192021222324252627282930313233 |
- Describe(strange_pair_tests)
- {
- It(should_work_for_these_pairs)
- {
- Assert::That(isStrangePair("ratio", "orator"), Equals(true));
- Assert::That(isStrangePair("sparkling", "groups"), Equals(true));
- Assert::That(isStrangePair("mentee", "eminem"), Equals(true));
- Assert::That(isStrangePair("yahtzee", "easy"), Equals(true));
- }
- It(should_not_work_for_these_pairs)
- {
- Assert::That(isStrangePair("bush", "hubris"), Equals(false));
- Assert::That(isStrangePair("false", "true"), Equals(false));
- Assert::That(isStrangePair("cupid", "dionysus"), Equals(false));
- Assert::That(isStrangePair("futile", "elephant"), Equals(false));
- }
- It(should_should_work_with_empty_strings)
- {
- Assert::That(isStrangePair("", ""), Equals(true));
- Assert::That(isStrangePair("", "abc"), Equals(false));
- }
- It(should_should_work_on_one_character_only)
- {
- Assert::That(isStrangePair("a", "a"), Equals(true));
- Assert::That(isStrangePair("a", "b"), Equals(false));
- }
- It(should_work_on_non_alphabetic_chars)
- {
- Assert::That(isStrangePair("&", "&"), Equals(true));
- Assert::That(isStrangePair("&!", "!&"), Equals(true));
- Assert::That(isStrangePair("5556", "65"), Equals(true));
- }
- };
|