From 8445219ef0eb1a1a3c865079801c67247f967be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Botond=20Bal=C3=A1zs?= Date: Thu, 9 Feb 2017 16:37:07 +0100 Subject: [PATCH] Acronym: Replace [] tests with individual tests (#298) (#299) * Fix #286 - Linked List: change pop and shift to return option * Linked List: Add missing Ignore attribute * Markdown: Use correct tags for italic and bold text * Revert "Fix #286 - Linked List: change pop and shift to return option" This reverts commit 9da0115e6543e5850d93fcbb54b7e3bf685d9d40. * Acronym: Replace [] tests with individual tests (#298) * acronym: Add missing [] attribute * Add missing [] attributes --- exercises/acronym/AcronymTest.fs | 65 +++++++++++++++++++++++++++----- 1 file changed, 56 insertions(+), 9 deletions(-) diff --git a/exercises/acronym/AcronymTest.fs b/exercises/acronym/AcronymTest.fs index 1bb224d12..ef4262729 100644 --- a/exercises/acronym/AcronymTest.fs +++ b/exercises/acronym/AcronymTest.fs @@ -6,12 +6,59 @@ open Acronym [] let ``Empty string abbreviated to empty string`` () = Assert.That(acronym "", Is.EqualTo("")) - -[] -[] -[] -[] -[] -[] -let ``Phrase abbreviated to acronym`` (phrase: string) = - acronym phrase \ No newline at end of file + +[] +[] +let ``Basic`` () = + let phrase = "Portable Network Graphics" + let expected = "PNG" + let actual = acronym phrase + Assert.That(expected, Is.EqualTo(actual)) + +[] +[] +let ``Lowercase words`` () = + let phrase = "Ruby on Rails" + let expected = "ROR" + let actual = acronym phrase + Assert.That(expected, Is.EqualTo(actual)) + +[] +[] +let ``Camel case`` () = + let phrase = "HyperText Markup Language" + let expected = "HTML" + let actual = acronym phrase + Assert.That(expected, Is.EqualTo(actual)) + +[] +[] +let ``Punctuation`` () = + let phrase = "First In, First Out" + let expected = "FIFO" + let actual = acronym phrase + Assert.That(expected, Is.EqualTo(actual)) + +[] +[] +let ``All-Caps words`` () = + let phrase = "PHP: Hypertext Preprocessor" + let expected = "PHP" + let actual = acronym phrase + Assert.That(expected, Is.EqualTo(actual)) + +[] +[] +let ``Non-acronym all-caps word`` () = + let phrase = "GNU Image Manipulation Program" + let expected = "GIMP" + let actual = acronym phrase + Assert.That(expected, Is.EqualTo(actual)) + +[] +[] +let ``Hyphenated`` () = + let phrase = "Complementary metal-oxide semiconductor" + let expected = "CMOS" + let actual = acronym phrase + Assert.That(expected, Is.EqualTo(actual)) \ No newline at end of file