This commit is contained in:
Patrick Stevens
2022-12-05 22:10:54 +00:00
committed by GitHub
parent 659c67a3e5
commit 0a498ac7d4
11 changed files with 802 additions and 72 deletions

View File

@@ -1,5 +1,6 @@
namespace AdventOfCode2022.Test
open System
open AdventOfCode2022
open NUnit.Framework
open FsUnitTyped
@@ -7,6 +8,23 @@ open FsUnitTyped
[<TestFixture>]
module TestDay1 =
let testInput =
"""1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
"""
[<Test>]
let ``Part 1`` () =
let input = Assembly.readResource "Day1.txt"
@@ -19,43 +37,9 @@ module TestDay1 =
[<Test>]
let ``Part 1, given example`` () =
"""1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
"""
|> fun s -> s.Split '\n'
|> Day1.part1
|> shouldEqual 24000
testInput.Split Environment.NewLine |> Day1.part1 |> shouldEqual 24000
[<Test>]
let ``Part 2, given example`` () =
"""1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
"""
|> fun s -> s.Split '\n'
|> Day1.part2
|> shouldEqual 45000
testInput.Split Environment.NewLine |> Day1.part2 |> shouldEqual 45000