1
exercism fetch fsharp wordy

WordyTest.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
62
63
64
65
66
67
68
69
70
71
72
73
// This file was auto-generated based on version 1.1.0 of the canonical data.

module WordyTest

open FsUnit.Xunit
open Xunit

open Wordy

[<Fact>]
let ``Addition`` () =
    answer "What is 1 plus 1?" |> should equal (Some 2)

[<Fact(Skip = "Remove to run test")>]
let ``More addition`` () =
    answer "What is 53 plus 2?" |> should equal (Some 55)

[<Fact(Skip = "Remove to run test")>]
let ``Addition with negative numbers`` () =
    answer "What is -1 plus -10?" |> should equal (Some -11)

[<Fact(Skip = "Remove to run test")>]
let ``Large addition`` () =
    answer "What is 123 plus 45678?" |> should equal (Some 45801)

[<Fact(Skip = "Remove to run test")>]
let ``Subtraction`` () =
    answer "What is 4 minus -12?" |> should equal (Some 16)

[<Fact(Skip = "Remove to run test")>]
let ``Multiplication`` () =
    answer "What is -3 multiplied by 25?" |> should equal (Some -75)

[<Fact(Skip = "Remove to run test")>]
let ``Division`` () =
    answer "What is 33 divided by -3?" |> should equal (Some -11)

[<Fact(Skip = "Remove to run test")>]
let ``Multiple additions`` () =
    answer "What is 1 plus 1 plus 1?" |> should equal (Some 3)

[<Fact(Skip = "Remove to run test")>]
let ``Addition and subtraction`` () =
    answer "What is 1 plus 5 minus -2?" |> should equal (Some 8)

[<Fact(Skip = "Remove to run test")>]
let ``Multiple subtraction`` () =
    answer "What is 20 minus 4 minus 13?" |> should equal (Some 3)

[<Fact(Skip = "Remove to run test")>]
let ``Subtraction then addition`` () =
    answer "What is 17 minus 6 plus 3?" |> should equal (Some 14)

[<Fact(Skip = "Remove to run test")>]
let ``Multiple multiplication`` () =
    answer "What is 2 multiplied by -2 multiplied by 3?" |> should equal (Some -12)

[<Fact(Skip = "Remove to run test")>]
let ``Addition and multiplication`` () =
    answer "What is -3 plus 7 multiplied by -2?" |> should equal (Some -8)

[<Fact(Skip = "Remove to run test")>]
let ``Multiple division`` () =
    answer "What is -12 divided by 2 divided by -3?" |> should equal (Some 2)

[<Fact(Skip = "Remove to run test")>]
let ``Unknown operation`` () =
    answer "What is 52 cubed?" |> should equal None

[<Fact(Skip = "Remove to run test")>]
let ``Non math question`` () =
    answer "Who is the President of the United States?" |> should equal None