diff --git a/SpriteCompiler.Test/Properties/AssemblyInfo.cs b/SpriteCompiler.Test/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..0b8dfb3 --- /dev/null +++ b/SpriteCompiler.Test/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("SpriteCompiler.Test")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SpriteCompiler.Test")] +[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("7b87bb8e-8c6e-4ce7-9130-6da8f9454d8c")] + +// 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/SpriteCompiler.Test/SpriteCompiler.Test.csproj b/SpriteCompiler.Test/SpriteCompiler.Test.csproj new file mode 100644 index 0000000..425e7e6 --- /dev/null +++ b/SpriteCompiler.Test/SpriteCompiler.Test.csproj @@ -0,0 +1,89 @@ + + + + Debug + AnyCPU + {7B87BB8E-8C6E-4CE7-9130-6DA8F9454D8C} + Library + Properties + SpriteCompiler.Test + SpriteCompiler.Test + 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 + + + + + + + + + + + + + + + + + + + + + + + {56f54ca9-17c1-45c6-915b-6fabf4dae5d0} + SpriteCompiler + + + + + + + False + + + False + + + False + + + False + + + + + + + + \ No newline at end of file diff --git a/SpriteCompiler.Test/Tests.cs b/SpriteCompiler.Test/Tests.cs new file mode 100644 index 0000000..8b2a184 --- /dev/null +++ b/SpriteCompiler.Test/Tests.cs @@ -0,0 +1,26 @@ +using System; +using System.Linq; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using SpriteCompiler.Problem; +using SpriteCompiler.AI; + +namespace SpriteCompiler.Test +{ + [TestClass] + public class Tests + { + [TestMethod] + public void TestEmptySprite() + { + // Arrange + var problem = SpriteGeneratorSearchProblem.CreateSearchProblem(); + var search = SpriteGeneratorSearchProblem.Create(); + + // Act : solve the problem + var solution = search.Search(problem, new SpriteGeneratorState()); + + // Assert : The initial state IS the goal state + Assert.AreEqual(1, solution.Count()); + } + } +} diff --git a/SpriteCompiler.sln b/SpriteCompiler.sln index 639647d..c148bc2 100644 --- a/SpriteCompiler.sln +++ b/SpriteCompiler.sln @@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpriteCompiler", "SpriteCompiler/SpriteCompiler.csproj", "{56F54CA9-17C1-45C6-915B-6FABF4DAE5D0}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpriteCompiler", "SpriteCompiler\SpriteCompiler.csproj", "{56F54CA9-17C1-45C6-915B-6FABF4DAE5D0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpriteCompiler.Test", "SpriteCompiler.Test\SpriteCompiler.Test.csproj", "{7B87BB8E-8C6E-4CE7-9130-6DA8F9454D8C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -15,6 +17,10 @@ Global {56F54CA9-17C1-45C6-915B-6FABF4DAE5D0}.Debug|Any CPU.Build.0 = Debug|Any CPU {56F54CA9-17C1-45C6-915B-6FABF4DAE5D0}.Release|Any CPU.ActiveCfg = Release|Any CPU {56F54CA9-17C1-45C6-915B-6FABF4DAE5D0}.Release|Any CPU.Build.0 = Release|Any CPU + {7B87BB8E-8C6E-4CE7-9130-6DA8F9454D8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7B87BB8E-8C6E-4CE7-9130-6DA8F9454D8C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7B87BB8E-8C6E-4CE7-9130-6DA8F9454D8C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7B87BB8E-8C6E-4CE7-9130-6DA8F9454D8C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE