Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grade school tests #1255

Merged
merged 6 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions exercises/practice/darts/DartsTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ let ``On the inner circle`` () =
score 0.0 -1.0 |> should equal 10

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``Exactly on centre`` () =
let ``Exactly on center`` () =
score 0.0 0.0 |> should equal 10

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``Near the centre`` () =
let ``Near the center`` () =
score -0.1 -0.1 |> should equal 10

[<Fact(Skip = "Remove this Skip property to run this test")>]
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/diffie-hellman/DiffieHellmanTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let ``Private key is greater than 1 and less than p`` () =

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``Private key is random`` () =
let p = 136739I
let p = 7919I
let privateKeys = [for _ in 0 .. 10 -> privateKey p]
List.distinct privateKeys |> List.length |> should equal (List.length privateKeys)

Expand Down
12 changes: 0 additions & 12 deletions exercises/practice/grade-school/GradeSchoolTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,3 @@ let ``Students are sorted by name in a grade`` () =
|> add "Jeff" 1
grade 5 school |> should equal ["Bradley"; "Franklin"]

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``Students are sorted by grades and then by name in the roster even when school was not sorted``() =
let school =
seq {
1, [ "Anna"; "Charlie"; "Barb" ]
2, [ "Peter"; "Zoe"; "Alex" ]
3, [ "Jim" ]
}
|> Map.ofSeq
roster school
|> should equal [ "Anna"; "Barb"; "Charlie"; "Alex"; "Peter"; "Zoe"; "Jim" ]

6 changes: 3 additions & 3 deletions exercises/practice/grains/GrainsTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ let ``Grains on square 64`` () =
square 64 |> should equal expected

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``Square 0 raises an exception`` () =
let ``Square 0 is invalid`` () =
let expected: Result<uint64,string> = Error "square must be between 1 and 64"
square 0 |> should equal expected

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``Negative square raises an exception`` () =
let ``Negative square is invalid`` () =
let expected: Result<uint64,string> = Error "square must be between 1 and 64"
square -1 |> should equal expected

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``Square greater than 64 raises an exception`` () =
let ``Square greater than 64 is invalid`` () =
let expected: Result<uint64,string> = Error "square must be between 1 and 64"
square 65 |> should equal expected

Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/poker/PokerTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ let ``Straight flush beats four of a kind`` () =
bestHands hands |> should equal expected

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``Both hands have straight flush, tie goes to highest-ranked card`` () =
let ``Both hands have a straight flush, tie goes to highest-ranked card`` () =
let hands = ["4H 6H 7H 8H 5H"; "5S 7S 8S 9S 6S"]
let expected = ["5S 7S 8S 9S 6S"]
bestHands hands |> should equal expected
Expand Down
40 changes: 20 additions & 20 deletions exercises/practice/roman-numerals/RomanNumeralsTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ let ``6 is VI`` () =
let ``9 is IX`` () =
roman 9 |> should equal "IX"

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``16 is XVI`` () =
roman 16 |> should equal "XVI"

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``27 is XXVII`` () =
roman 27 |> should equal "XXVII"
Expand All @@ -49,6 +53,10 @@ let ``49 is XLIX`` () =
let ``59 is LIX`` () =
roman 59 |> should equal "LIX"

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``66 is LXVI`` () =
roman 66 |> should equal "LXVI"

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``93 is XCIII`` () =
roman 93 |> should equal "XCIII"
Expand All @@ -61,6 +69,10 @@ let ``141 is CXLI`` () =
let ``163 is CLXIII`` () =
roman 163 |> should equal "CLXIII"

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``166 is CLXVI`` () =
roman 166 |> should equal "CLXVI"

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``402 is CDII`` () =
roman 402 |> should equal "CDII"
Expand All @@ -69,6 +81,10 @@ let ``402 is CDII`` () =
let ``575 is DLXXV`` () =
roman 575 |> should equal "DLXXV"

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``666 is DCLXVI`` () =
roman 666 |> should equal "DCLXVI"

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``911 is CMXI`` () =
roman 911 |> should equal "CMXI"
Expand All @@ -77,30 +93,14 @@ let ``911 is CMXI`` () =
let ``1024 is MXXIV`` () =
roman 1024 |> should equal "MXXIV"

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``3000 is MMM`` () =
roman 3000 |> should equal "MMM"

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``16 is XVI`` () =
roman 16 |> should equal "XVI"

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``66 is LXVI`` () =
roman 66 |> should equal "LXVI"

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``166 is CLXVI`` () =
roman 166 |> should equal "CLXVI"

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``666 is DCLXVI`` () =
roman 666 |> should equal "DCLXVI"

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``1666 is MDCLXVI`` () =
roman 1666 |> should equal "MDCLXVI"

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``3000 is MMM`` () =
roman 3000 |> should equal "MMM"

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``3001 is MMMI`` () =
roman 3001 |> should equal "MMMI"
Expand Down
1 change: 1 addition & 0 deletions generators/Generators.fs
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,7 @@ type GradeSchool() =

override _.PropertiesUsedAsSutParameter testCase =
base.PropertiesUsedAsSutParameter testCase |> List.filter (fun x -> x <> "students")

type Grains() =
inherit ExerciseGenerator()

Expand Down