Skip to content

Commit

Permalink
clock: Replace [<TestCase>] tests with individual tests (exercism#298) (
Browse files Browse the repository at this point in the history
exercism#301)

* Fix exercism#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 exercism#286 - Linked List: change pop and shift to return option"

This reverts commit 9da0115.

* clock: Replace [<TestCase>] tests with individual tests (exercism#298)
  • Loading branch information
balazsbotond authored and robkeim committed Feb 9, 2017
1 parent 8445219 commit 5e18ac6
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions exercises/clock/ClockTest.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,28 @@ open System
open NUnit.Framework
open Clock

[<TestCase(8, "08:00")>]
[<TestCase(9, "09:00", Ignore = "Remove to run test case")>]
let ``Prints the hour`` (hours: int, expected: string) =
let clock = mkClock hours 0
Assert.That(display clock, Is.EqualTo(expected))

[<TestCase(11, 9, "11:09", Ignore = "Remove to run test case")>]
[<TestCase(11, 19, "11:19", Ignore = "Remove to run test case")>]
let ``Prints past the hour`` (hours: int) (minutes: int) (expected: string) =
let clock = mkClock hours minutes
Assert.That(display clock, Is.EqualTo(expected))
[<Test>]
let ``Prints 8 o'clock`` () =
let clock = mkClock 8 0
Assert.That(display clock, Is.EqualTo("08:00"))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Prints 9 o'clock`` () =
let clock = mkClock 9 0
Assert.That(display clock, Is.EqualTo("09:00"))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Can print single-digit minutes`` () =
let clock = mkClock 11 9
Assert.That(display clock, Is.EqualTo("11:09"))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Can print double-digit minutes`` () =
let clock = mkClock 11 19
Assert.That(display clock, Is.EqualTo("11:19"))

[<Test>]
[<Ignore("Remove to run test")>]
Expand Down

0 comments on commit 5e18ac6

Please sign in to comment.