diff --git a/.gitignore b/.gitignore index f71240d1..06f8bff4 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,7 @@ obj/ !**/Bin/Debug/data/* !**/Bin/Debug/data/ !**/Bin/Debug/credentials_example.json -Tests/ +Tests/bin # NuGet Packages *.nupkg diff --git a/Tests/Properties/AssemblyInfo.cs b/Tests/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..78a9225b --- /dev/null +++ b/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("Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Tests")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[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("45b2545d-c612-4919-b34c-d65ea1371c51")] + +// 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/Tests/TestCards.cs b/Tests/TestCards.cs new file mode 100644 index 00000000..f0f4e8f9 --- /dev/null +++ b/Tests/TestCards.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using static NadekoBot.Classes.Cards; + +namespace Tests { + [TestClass] + public class TestCards { + [TestMethod] + public void TestHandValues() { + var setting1 = new List { + new Card(CardSuit.Clubs,10), + new Card(CardSuit.Clubs,10), + new Card(CardSuit.Clubs,10), + new Card(CardSuit.Clubs,11), + new Card(CardSuit.Diamonds,12), + }; + var result1 = "Three Of A Kind"; + + var setting2 = new List { + new Card(CardSuit.Clubs,1), + new Card(CardSuit.Hearts,2), + new Card(CardSuit.Clubs,3), + new Card(CardSuit.Spades,4), + new Card(CardSuit.Diamonds,5), + }; + var result2 = "Straight"; + + var setting3 = new List { + new Card(CardSuit.Diamonds,10), + new Card(CardSuit.Diamonds,11), + new Card(CardSuit.Diamonds,12), + new Card(CardSuit.Diamonds,13), + new Card(CardSuit.Diamonds,1), + }; + var result3 = "Royal Flush"; + + Assert.AreEqual(GetHandValue(setting1), result1); + Assert.AreEqual(GetHandValue(setting2), result2); + Assert.AreEqual(GetHandValue(setting3), result3); + } + } +} diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj new file mode 100644 index 00000000..d83b8b1a --- /dev/null +++ b/Tests/Tests.csproj @@ -0,0 +1,90 @@ + + + + Debug + AnyCPU + {45B2545D-C612-4919-B34C-D65EA1371C51} + Library + Properties + Tests + Tests + v4.5.2 + 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 + + + + + + + + + + + + + + + + + + + + + + + {27a886f5-cdda-4f4a-81ee-6dafcce9de46} + NadekoBot + + + + + + + False + + + False + + + False + + + False + + + + + + + + \ No newline at end of file