Files
advent-of-code-2023/AdventOfCode2023.FSharp/Test/TestDay15.fs
Smaug123 012bbdd46d Bones
2023-12-14 23:18:38 +00:00

49 lines
1.2 KiB
Forth

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