Files
advent-of-code-2023/AdventOfCode2023.FSharp/Test/TestDay16.fs
Smaug123 87c422e6d5 Part 1
2023-12-16 11:20:07 +00:00

47 lines
1.2 KiB
Forth

namespace AdventOfCode2023.Test
open AdventOfCode2023
open NUnit.Framework
open FsUnitTyped
open System.IO
[<TestFixture>]
module TestDay16 =
[<Test>]
let sample = Assembly.getEmbeddedResource typeof<Dummy>.Assembly "day16.txt"
[<Test>]
let part1Sample () =
sample |> Day16.part1 |> shouldEqual 46
[<Test>]
let part2Sample () =
sample |> Day16.part2 |> shouldEqual 51
[<Test>]
let part1Actual () =
let s =
try
File.ReadAllText (Path.Combine (__SOURCE_DIRECTORY__, "../../inputs/day16.txt"))
with
| :? DirectoryNotFoundException
| :? FileNotFoundException ->
Assert.Inconclusive ()
failwith "unreachable"
Day16.part1 s |> shouldEqual 8112
[<Test>]
let part2Actual () =
let s =
try
File.ReadAllText (Path.Combine (__SOURCE_DIRECTORY__, "../../inputs/day16.txt"))
with
| :? DirectoryNotFoundException
| :? FileNotFoundException ->
Assert.Inconclusive ()
failwith "unreachable"
Day16.part2 s |> shouldEqual 0