diff --git a/.gitignore b/.gitignore index d7b7d39..d0ea75b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ */bin/* */obj/* /.vs/* +packages/* diff --git a/AdventOfCode2018.Tests/AdventOfCode2018.Tests.csproj b/AdventOfCode2018.Tests/AdventOfCode2018.Tests.csproj new file mode 100644 index 0000000..0879b8e --- /dev/null +++ b/AdventOfCode2018.Tests/AdventOfCode2018.Tests.csproj @@ -0,0 +1,106 @@ + + + + + Debug + AnyCPU + {EE35694D-97C1-485D-9FFE-73912FA97446} + Library + Properties + AdventOfCode2018Tests + AdventOfCode2018Tests + v4.6.1 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll + + + ..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + + + + + + + + + + + + + + + + + + + + + {43DAF84F-369A-48C5-9292-536094336F8F} + AdventOfCode2018 + + + + + + + False + + + False + + + False + + + False + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + \ No newline at end of file diff --git a/AdventOfCode2018.Tests/Day01_Tests.cs b/AdventOfCode2018.Tests/Day01_Tests.cs new file mode 100644 index 0000000..d5c7691 --- /dev/null +++ b/AdventOfCode2018.Tests/Day01_Tests.cs @@ -0,0 +1,48 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace AdventOfCode2018.Tests +{ + [TestClass()] + public class Day01_Tests + { + [TestMethod()] + public void ResolveDay01__Test1() + { + Day01 day01 = new Day01(); + + string result = day01.ResolveDay01(new string[] { "+1", "-2", "+3", "+1", }); + + Assert.AreEqual("3", result); + } + + [TestMethod()] + public void ResolveDay01__Test2() + { + Day01 day01 = new Day01(); + + string result = day01.ResolveDay01(new string[] { "+1", "+1", "+1", }); + + Assert.AreEqual("3", result); + } + + [TestMethod()] + public void ResolveDay01__Test3() + { + Day01 day01 = new Day01(); + + string result = day01.ResolveDay01(new string[] { "+1", "+1", "-2", }); + + Assert.AreEqual("0", result); + } + + [TestMethod()] + public void ResolveDay01__Test4() + { + Day01 day01 = new Day01(); + + string result = day01.ResolveDay01(new string[] { "-1", "-2", "-3", }); + + Assert.AreEqual("-6", result); + } + } +} \ No newline at end of file diff --git a/AdventOfCode2018.Tests/Properties/AssemblyInfo.cs b/AdventOfCode2018.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ee2b80e --- /dev/null +++ b/AdventOfCode2018.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("AdventOfCode2018Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("AdventOfCode2018Tests")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ee35694d-97c1-485d-9ffe-73912fa97446")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AdventOfCode2018.Tests/packages.config b/AdventOfCode2018.Tests/packages.config new file mode 100644 index 0000000..102a45c --- /dev/null +++ b/AdventOfCode2018.Tests/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/AdventOfCode2018.sln b/AdventOfCode2018.sln index 98a2599..3577bbc 100644 --- a/AdventOfCode2018.sln +++ b/AdventOfCode2018.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.28307.136 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdventOfCode2018", "AdventOfCode2018\AdventOfCode2018.csproj", "{43DAF84F-369A-48C5-9292-536094336F8F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdventOfCode2018.Tests", "AdventOfCode2018.Tests\AdventOfCode2018.Tests.csproj", "{EE35694D-97C1-485D-9FFE-73912FA97446}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +17,10 @@ Global {43DAF84F-369A-48C5-9292-536094336F8F}.Debug|Any CPU.Build.0 = Debug|Any CPU {43DAF84F-369A-48C5-9292-536094336F8F}.Release|Any CPU.ActiveCfg = Release|Any CPU {43DAF84F-369A-48C5-9292-536094336F8F}.Release|Any CPU.Build.0 = Release|Any CPU + {EE35694D-97C1-485D-9FFE-73912FA97446}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EE35694D-97C1-485D-9FFE-73912FA97446}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EE35694D-97C1-485D-9FFE-73912FA97446}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EE35694D-97C1-485D-9FFE-73912FA97446}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE