Sha256: 8bcf95613c8d1598c54fa8d04a9b228aeaaca2360359f2acd57fec3750b5682a

Contents?: true

Size: 1.89 KB

Versions: 55

Compression:

Stored size: 1.89 KB

Contents

module GradeSchoolTest

open Xunit
open FsUnit.Xunit
open GradeSchool

[<Fact>]
let ``Empty school has an empty roster`` () =
    let school = empty
    roster school |> should be Empty

[<Fact(Skip = "Remove to run test")>]
let ``Adding a student adds them to the roster for the given grade`` () =
    let school = empty |> add "Aimee" 2
    let expected = ["Aimee"]
    grade 2 school |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Adding more students to the same grade adds them to the roster`` () =
    let school = 
        empty
        |> add "Blair" 2
        |> add "James" 2
        |> add "Paul" 2
    let expected = ["Blair"; "James"; "Paul"]
    grade 2 school |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Adding students to different grades adds them to the roster`` () =
    let school = 
        empty
        |> add "Chelsea" 3
        |> add "Logan" 7
    grade 3 school |> should equal ["Chelsea"]
    grade 7 school |> should equal ["Logan"]

[<Fact(Skip = "Remove to run test")>]
let ``Grade returns the students in that grade in alphabetical order`` () =
    let school = 
        empty
        |> add "Franklin" 5
        |> add "Bradley" 5
        |> add "Jeff" 1
    let expected = ["Bradley"; "Franklin"]
    grade 5 school |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Grade returns an empty list if there are no students in that grade`` () =
    let school = empty
    grade 1 school |> should be Empty

[<Fact(Skip = "Remove to run test")>]
let ``Student names and grades in roster are sorted`` () =
    let school =
        empty        
        |> add "Jennifer" 4
        |> add "Kareem" 6
        |> add "Christopher" 4
        |> add "Kyle" 3
        |> add "Zoe" 4

    let expected = 
        [(3, ["Kyle"]);
         (4, ["Christopher"; "Jennifer"; "Zoe"]);
         (6, ["Kareem"])]

    roster school |> should equal expected

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
trackler-2.2.1.98 tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs
trackler-2.2.1.97 tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs
trackler-2.2.1.96 tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs
trackler-2.2.1.95 tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs
trackler-2.2.1.94 tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs
trackler-2.2.1.93 tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs
trackler-2.2.1.92 tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs
trackler-2.2.1.91 tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs
trackler-2.2.1.90 tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs
trackler-2.2.1.89 tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs
trackler-2.2.1.88 tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs
trackler-2.2.1.87 tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs
trackler-2.2.1.86 tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs
trackler-2.2.1.85 tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs
trackler-2.2.1.84 tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs
trackler-2.2.1.83 tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs
trackler-2.2.1.82 tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs
trackler-2.2.1.81 tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs
trackler-2.2.1.80 tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs
trackler-2.2.1.79 tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs