mirror of
https://github.com/Smaug123/AdventOfCode2022
synced 2025-10-05 09:38:40 +00:00
34 lines
731 B
Forth
34 lines
731 B
Forth
namespace AdventOfCode2022.Test
|
|
|
|
open System
|
|
open NUnit.Framework
|
|
open FsUnitTyped
|
|
open AdventOfCode2022
|
|
|
|
[<TestFixture>]
|
|
module TestDay2 =
|
|
|
|
let testInput =
|
|
"""A Y
|
|
B X
|
|
C Z"""
|
|
|
|
[<Test>]
|
|
let ``Part 1, given`` () =
|
|
testInput.Split Environment.NewLine |> Day2.part1 |> shouldEqual 15
|
|
|
|
[<Test>]
|
|
let ``Part 1`` () =
|
|
let input = Assembly.readResource "Day2.txt"
|
|
input.Split '\n' |> Day2.part1 |> shouldEqual 9651
|
|
|
|
|
|
[<Test>]
|
|
let ``Part 2, given`` () =
|
|
testInput.Split Environment.NewLine |> Day2.part2 |> shouldEqual 12
|
|
|
|
[<Test>]
|
|
let ``Part 2`` () =
|
|
let input = Assembly.readResource "Day2.txt"
|
|
input.Split '\n' |> Day2.part2 |> shouldEqual 10560
|