This commit is contained in:
Patrick Stevens
2022-12-08 18:47:53 +00:00
committed by GitHub
parent ed0e191990
commit 1c3a31de26
7 changed files with 311 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
namespace AdventOfCode2022.Test
open System
open NUnit.Framework
open FsUnitTyped
open AdventOfCode2022
[<TestFixture>]
module TestDay8 =
let input =
"""30373
25512
65332
33549
35390
"""
[<Test>]
let ``Part 1, given`` () =
Day8.part1 (StringSplitEnumerator.make '\n' input) |> shouldEqual 21
[<Test>]
let ``Part 1`` () =
let input = Assembly.readResource "Day8.txt"
Day8.part1 (StringSplitEnumerator.make '\n' input) |> shouldEqual 1823
[<Test>]
let ``Part 2, given`` () =
Day8.part2 (StringSplitEnumerator.make '\n' input) |> shouldEqual 8
[<Test>]
let ``Part 2`` () =
let input = Assembly.readResource "Day8.txt"
Day8.part2 (StringSplitEnumerator.make '\n' input) |> shouldEqual 211680