From 5e18ac69f1b793ecaa55a88ac54611262e5c66ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Botond=20Bal=C3=A1zs?= Date: Thu, 9 Feb 2017 16:38:40 +0100 Subject: [PATCH] clock: Replace [] tests with individual tests (#298) (#301) * 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. * clock: Replace [] tests with individual tests (#298) --- exercises/clock/ClockTest.fs | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/exercises/clock/ClockTest.fs b/exercises/clock/ClockTest.fs index a153a5c63..c3350f316 100644 --- a/exercises/clock/ClockTest.fs +++ b/exercises/clock/ClockTest.fs @@ -4,17 +4,28 @@ open System open NUnit.Framework open Clock -[] -[] -let ``Prints the hour`` (hours: int, expected: string) = - let clock = mkClock hours 0 - Assert.That(display clock, Is.EqualTo(expected)) - -[] -[] -let ``Prints past the hour`` (hours: int) (minutes: int) (expected: string) = - let clock = mkClock hours minutes - Assert.That(display clock, Is.EqualTo(expected)) +[] +let ``Prints 8 o'clock`` () = + let clock = mkClock 8 0 + Assert.That(display clock, Is.EqualTo("08:00")) + +[] +[] +let ``Prints 9 o'clock`` () = + let clock = mkClock 9 0 + Assert.That(display clock, Is.EqualTo("09:00")) + +[] +[] +let ``Can print single-digit minutes`` () = + let clock = mkClock 11 9 + Assert.That(display clock, Is.EqualTo("11:09")) + +[] +[] +let ``Can print double-digit minutes`` () = + let clock = mkClock 11 19 + Assert.That(display clock, Is.EqualTo("11:19")) [] []