-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSection_02_Tests.fs
42 lines (34 loc) · 1.25 KB
/
Section_02_Tests.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
namespace FPinFSharp.Chapter_02.UnitTests
open FPinFSharp.Chapter_02.Section_02
open Xunit
module Section_02_Tests =
[<Theory>]
[<InlineData(1, 3, 4)>]
let ``Should add 2 numbers`` a b expectedResult =
let actualResult = add a b
Assert.Equal(expectedResult, actualResult)
[<Theory>]
[<InlineData(1, 3, -2)>]
let ``Should subtract 2 numbers`` a b expectedResult =
let actualResult = subtract a b
Assert.Equal(expectedResult, actualResult)
[<Theory>]
[<InlineData(3, 4, 12)>]
let ``Should multiply 2 numbers`` x y expectedResult =
let actualResult = multiply x y
Assert.Equal(expectedResult, actualResult)
[<Theory>]
[<InlineData(10, 2, 5)>]
let ``Should divide 2 numbers`` x y expectedResult =
let actualResult = divide x y
Assert.Equal(expectedResult, actualResult)
[<Theory>]
[<InlineData(10, 3, 1)>]
let ``Should modulo 2 numbers`` x y expectedResult =
let actualResult = modulo x y
Assert.Equal(expectedResult, actualResult)
[<Theory>]
[<InlineData(10, 3, 1000)>]
let ``Should exponentiate 2 numbers`` x y expectedResult =
let actualResult = exponentiate x y
Assert.Equal(expectedResult, actualResult)