1
exercism fetch fsharp book-store

BookStoreTest.fs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// This file was auto-generated based on version 1.0.1 of the canonical data.

module BookStoreTest

open FsUnit.Xunit
open Xunit

open BookStore

[<Fact>]
let ``Only a single book`` () =
    total [1] |> should equal 8.00

[<Fact(Skip = "Remove to run test")>]
let ``Two of the same book`` () =
    total [2; 2] |> should equal 16.00

[<Fact(Skip = "Remove to run test")>]
let ``Empty basket`` () =
    total [] |> should equal 0.00

[<Fact(Skip = "Remove to run test")>]
let ``Two different books`` () =
    total [1; 2] |> should equal 15.20

[<Fact(Skip = "Remove to run test")>]
let ``Three different books`` () =
    total [1; 2; 3] |> should equal 21.60

[<Fact(Skip = "Remove to run test")>]
let ``Four different books`` () =
    total [1; 2; 3; 4] |> should equal 25.60

[<Fact(Skip = "Remove to run test")>]
let ``Five different books`` () =
    total [1; 2; 3; 4; 5] |> should equal 30.00

[<Fact(Skip = "Remove to run test")>]
let ``Two groups of four is cheaper than group of five plus group of three`` () =
    total [1; 1; 2; 2; 3; 3; 4; 5] |> should equal 51.20

[<Fact(Skip = "Remove to run test")>]
let ``Group of four plus group of two is cheaper than two groups of three`` () =
    total [1; 1; 2; 2; 3; 4] |> should equal 40.80

[<Fact(Skip = "Remove to run test")>]
let ``Two each of first 4 books and 1 copy each of rest`` () =
    total [1; 1; 2; 2; 3; 3; 4; 4; 5] |> should equal 55.60

[<Fact(Skip = "Remove to run test")>]
let ``Two copies of each book`` () =
    total [1; 1; 2; 2; 3; 3; 4; 4; 5; 5] |> should equal 60.00

[<Fact(Skip = "Remove to run test")>]
let ``Three copies of first book and 2 each of remaining`` () =
    total [1; 1; 2; 2; 3; 3; 4; 4; 5; 5; 1] |> should equal 68.00

[<Fact(Skip = "Remove to run test")>]
let ``Three each of first 2 books and 2 each of remaining books`` () =
    total [1; 1; 2; 2; 3; 3; 4; 4; 5; 5; 1; 2] |> should equal 75.20