Skip to content

Commit

Permalink
atbash-cipher: Replace [<TestCase>] tests with individual tests (#298) (
Browse files Browse the repository at this point in the history
#300)

* 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 9da0115.

* atbash-cipher: Replace [<TestCase>] tests with individual tests (#298)

* Add missing [<Test>] attribute

* Add missing [<Ignore>] attributes
  • Loading branch information
balazsbotond authored and robkeim committed Feb 9, 2017
1 parent 7ed1023 commit 2740569
Showing 1 changed file with 62 additions and 9 deletions.
71 changes: 62 additions & 9 deletions exercises/atbash-cipher/AtbashTest.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,65 @@ module AtbashTest
open NUnit.Framework
open Atbash

[<TestCase("no", ExpectedResult = "ml")>]
[<TestCase("yes", ExpectedResult = "bvh", Ignore = "Remove to run test case")>]
[<TestCase("OMG", ExpectedResult = "lnt", Ignore = "Remove to run test case")>]
[<TestCase("mindblowingly", ExpectedResult = "nrmwy oldrm tob", Ignore = "Remove to run test case")>]
[<TestCase("Testing, 1 2 3, testing.", ExpectedResult = "gvhgr mt123 gvhgr mt", Ignore = "Remove to run test case")>]
[<TestCase("Truth is fiction.", ExpectedResult = "gifgs rhurx grlm", Ignore = "Remove to run test case")>]
[<TestCase("The quick brown fox jumps over the lazy dog.", ExpectedResult = "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt", Ignore = "Remove to run test case")>]
let ``Encodes words using atbash cipher`` words =
encode words
[<Test>]
let ``Encode yes`` () =
let phrase = "yes"
let expected = "bvh"
let actual = encode phrase
Assert.That(actual, Is.EqualTo(expected))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Encode no`` () =
let phrase = "no"
let expected = "ml"
let actual = encode phrase
Assert.That(actual, Is.EqualTo(expected))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Encode OMG`` () =
let phrase = "OMG"
let expected = "lnt"
let actual = encode phrase
Assert.That(actual, Is.EqualTo(expected))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Encode spaces`` () =
let phrase = "O M G"
let expected = "lnt"
let actual = encode phrase
Assert.That(actual, Is.EqualTo(expected))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Encode mindblowingly`` () =
let phrase = "mindblowingly"
let expected = "nrmwy oldrm tob"
let actual = encode phrase
Assert.That(actual, Is.EqualTo(expected))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Encode numbers`` () =
let phrase = "Testing, 1 2 3, testing."
let expected = "gvhgr mt123 gvhgr mt"
let actual = encode phrase
Assert.That(actual, Is.EqualTo(expected))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Encode deep thought`` () =
let phrase = "Truth is fiction."
let expected = "gifgs rhurx grlm"
let actual = encode phrase
Assert.That(actual, Is.EqualTo(expected))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Encode all the letters`` () =
let phrase = "The quick brown fox jumps over the lazy dog."
let expected = "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt"
let actual = encode phrase
Assert.That(actual, Is.EqualTo(expected))

0 comments on commit 2740569

Please sign in to comment.