From 988e745c7953d8e5d7edcedbf93f9578dfb087b4 Mon Sep 17 00:00:00 2001 From: Greg Burri Date: Sun, 3 Dec 2017 22:24:56 +0100 Subject: [PATCH] Remove mutable, simplify code add unit tests. --- AdventOfCode2017.sln | 6 ++ AdventOfCode2017/AdventOfCode2017.fsproj | 5 +- AdventOfCode2017/Day3.fs | 44 ++++----- AdventOfCode2017/packages.config | 2 +- Tests/App.config | 6 ++ Tests/AssemblyInfo.fs | 41 ++++++++ Tests/Day1 tests.fs | 24 +++++ Tests/Day2 tests.fs | 25 +++++ Tests/Day3 tests.fs | 26 ++++++ Tests/Tests.fsproj | 113 +++++++++++++++++++++++ Tests/packages.config | 14 +++ 11 files changed, 275 insertions(+), 31 deletions(-) create mode 100644 Tests/App.config create mode 100644 Tests/AssemblyInfo.fs create mode 100644 Tests/Day1 tests.fs create mode 100644 Tests/Day2 tests.fs create mode 100644 Tests/Day3 tests.fs create mode 100644 Tests/Tests.fsproj create mode 100644 Tests/packages.config diff --git a/AdventOfCode2017.sln b/AdventOfCode2017.sln index 78a0214..b07e76f 100644 --- a/AdventOfCode2017.sln +++ b/AdventOfCode2017.sln @@ -11,6 +11,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution LICENSE = LICENSE EndProjectSection EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Tests", "Tests\Tests.fsproj", "{238BFFBE-E2D4-4DC4-804C-6E43205E4701}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,6 +23,10 @@ Global {D3555943-8102-43D1-B3CB-570A4E4EC513}.Debug|Any CPU.Build.0 = Debug|Any CPU {D3555943-8102-43D1-B3CB-570A4E4EC513}.Release|Any CPU.ActiveCfg = Release|Any CPU {D3555943-8102-43D1-B3CB-570A4E4EC513}.Release|Any CPU.Build.0 = Release|Any CPU + {238BFFBE-E2D4-4DC4-804C-6E43205E4701}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {238BFFBE-E2D4-4DC4-804C-6E43205E4701}.Debug|Any CPU.Build.0 = Debug|Any CPU + {238BFFBE-E2D4-4DC4-804C-6E43205E4701}.Release|Any CPU.ActiveCfg = Release|Any CPU + {238BFFBE-E2D4-4DC4-804C-6E43205E4701}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/AdventOfCode2017/AdventOfCode2017.fsproj b/AdventOfCode2017/AdventOfCode2017.fsproj index 31f6027..01ee4ac 100644 --- a/AdventOfCode2017/AdventOfCode2017.fsproj +++ b/AdventOfCode2017/AdventOfCode2017.fsproj @@ -61,13 +61,13 @@ - PreserveNewest PreserveNewest + @@ -80,7 +80,8 @@ - ..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll + ..\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll + True + \ No newline at end of file diff --git a/Tests/packages.config b/Tests/packages.config new file mode 100644 index 0000000..41b642a --- /dev/null +++ b/Tests/packages.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file -- 2.45.2