diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2020-05-19 13:29:09 +0300 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2020-05-19 13:29:09 +0300 |
| commit | d580ea82d48831e3cf243e5b250bf7076c8a6b1b (patch) | |
| tree | defb059237edd0b65bf513ac696d90a13e28581f /MundusTests | |
| parent | 65c474e881e880a71710aaf560f9afddecdb3e38 (diff) | |
| download | Mundus-d580ea82d48831e3cf243e5b250bf7076c8a6b1b.tar Mundus-d580ea82d48831e3cf243e5b250bf7076c8a6b1b.tar.gz Mundus-d580ea82d48831e3cf243e5b250bf7076c8a6b1b.zip | |
Added final data test (that I didn't think I could do)
Diffstat (limited to 'MundusTests')
| -rw-r--r-- | MundusTests/DataTests/Mobs/MITests.cs | 27 | ||||
| -rw-r--r-- | MundusTests/MundusTests.csproj | 16 | ||||
| -rw-r--r-- | MundusTests/ServiceTests/SuperLayers/HeightControllerTests.cs | 30 | ||||
| -rw-r--r-- | MundusTests/packages.config | 7 |
4 files changed, 69 insertions, 11 deletions
diff --git a/MundusTests/DataTests/Mobs/MITests.cs b/MundusTests/DataTests/Mobs/MITests.cs new file mode 100644 index 0000000..03cc893 --- /dev/null +++ b/MundusTests/DataTests/Mobs/MITests.cs @@ -0,0 +1,27 @@ +namespace MundusTests.DataTests.Mobs +{ + using Gtk; + using Mundus.Data; + using Mundus.Data.Tiles.Mobs; + using Mundus.Data.Windows; + using NUnit.Framework; + + [TestFixture] + public static class MITests + { + [SetUp] + public static void SetUp() + { + Application.Init(); + DataBaseContexts.CreateInstances(); + WI.CreateInstances(); + WI.WNewGame.OnBtnGenerateClicked(null, null); + } + + [Test] + public static void CreatesPlayerInstance() + { + Assert.AreNotEqual(null, MI.Player, "Player isn't instantiated"); + } + } +} diff --git a/MundusTests/MundusTests.csproj b/MundusTests/MundusTests.csproj index 820627c..e8f95c8 100644 --- a/MundusTests/MundusTests.csproj +++ b/MundusTests/MundusTests.csproj @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -27,7 +28,7 @@ <ItemGroup>
<Reference Include="System" />
<Reference Include="nunit.framework">
- <HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
+ <HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.HashCode">
<HintPath>..\packages\Microsoft.Bcl.HashCode.1.1.0\lib\net461\Microsoft.Bcl.HashCode.dll</HintPath>
@@ -120,9 +121,6 @@ <Reference Include="GdkSharp">
<HintPath>..\packages\GdkSharp.3.22.25.74\lib\netstandard2.0\GdkSharp.dll</HintPath>
</Reference>
- <Reference Include="GtkSharp">
- <HintPath>..\packages\GtkSharp.3.22.25.74\lib\netstandard2.0\GtkSharp.dll</HintPath>
- </Reference>
<Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
@@ -130,10 +128,10 @@ <HintPath>..\packages\Microsoft.EntityFrameworkCore.Relational.3.1.4\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Relational.dll</HintPath>
</Reference>
<Reference Include="BouncyCastle.Crypto">
- <HintPath>..\packages\BouncyCastle.1.8.3.1\lib\BouncyCastle.Crypto.dll</HintPath>
+ <HintPath>..\packages\BouncyCastle.1.8.6.1\lib\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="Google.Protobuf">
- <HintPath>..\packages\Google.Protobuf.3.6.1\lib\net45\Google.Protobuf.dll</HintPath>
+ <HintPath>..\packages\Google.Protobuf.3.12.0\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="Renci.SshNet">
<HintPath>..\packages\SSH.NET.2016.1.0\lib\net40\Renci.SshNet.dll</HintPath>
@@ -187,6 +185,8 @@ <Compile Include="DataTests\SuperLayers\DBTables\UMPlacedTileTests.cs" />
<Compile Include="DataTests\SuperLayers\DBTables\USPlacedTileTests.cs" />
<Compile Include="DataTests\DataBaseContextsTests.cs" />
+ <Compile Include="ServiceTests\SuperLayers\HeightControllerTests.cs" />
+ <Compile Include="DataTests\Mobs\MITests.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
@@ -197,6 +197,9 @@ <Folder Include="DataTests\Crafting\" />
<Folder Include="DataTests\SuperLayers\" />
<Folder Include="DataTests\SuperLayers\DBTables\" />
+ <Folder Include="ServiceTests\" />
+ <Folder Include="ServiceTests\SuperLayers\" />
+ <Folder Include="DataTests\Mobs\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Mundus\Mundus.csproj">
@@ -205,5 +208,4 @@ </ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Import Project="..\packages\GtkSharp.3.22.25.74\build\GtkSharp.targets" Condition="Exists('..\packages\GtkSharp.3.22.25.74\build\GtkSharp.targets')" />
</Project>
\ No newline at end of file diff --git a/MundusTests/ServiceTests/SuperLayers/HeightControllerTests.cs b/MundusTests/ServiceTests/SuperLayers/HeightControllerTests.cs new file mode 100644 index 0000000..0612454 --- /dev/null +++ b/MundusTests/ServiceTests/SuperLayers/HeightControllerTests.cs @@ -0,0 +1,30 @@ +namespace MundusTests.ServiceTests.SuperLayers
+{
+ using Mundus.Data; + using Mundus.Service.SuperLayers; + using NUnit.Framework;
+ + [TestFixture] + public static class HeightControllerTests
+ { + [Test] + public static void GetsCorrectSuperLayerUnderneath()
+ {
+ DataBaseContexts.CreateInstances();
+
+ Assert.AreEqual(DataBaseContexts.LContext, HeightController.GetSuperLayerUnderneath(DataBaseContexts.SContext), "GetSuperLayerUnderneath doesn't return that land is below sky");
+ Assert.AreEqual(DataBaseContexts.UContext, HeightController.GetSuperLayerUnderneath(DataBaseContexts.LContext), "GetSuperLayerUnderneath doesn't return that underground is below land");
+ Assert.AreEqual(null, HeightController.GetSuperLayerUnderneath(DataBaseContexts.UContext), "GetSuperLayerUnderneath doesn't return that there is nothing (null) below underground");
+ }
+
+ [Test]
+ public static void GetsCorrectSuperLayerAbove()
+ { + DataBaseContexts.CreateInstances();
+
+ Assert.AreEqual(null, HeightController.GetSuperLayerAbove(DataBaseContexts.SContext), "GetSuperLayerUnderneath doesn't return that there is nothing (null) above sky");
+ Assert.AreEqual(DataBaseContexts.SContext, HeightController.GetSuperLayerAbove(DataBaseContexts.LContext), "GetSuperLayerUnderneath doesn't return that sky is above land");
+ Assert.AreEqual(DataBaseContexts.LContext, HeightController.GetSuperLayerAbove(DataBaseContexts.UContext), "GetSuperLayerUnderneath doesn't return that land is above underground"); + } + } +} diff --git a/MundusTests/packages.config b/MundusTests/packages.config index f3e0a41..348b94a 100644 --- a/MundusTests/packages.config +++ b/MundusTests/packages.config @@ -1,13 +1,12 @@ <?xml version="1.0" encoding="utf-8"?> <packages> <package id="AtkSharp" version="3.22.25.74" targetFramework="net47" /> - <package id="BouncyCastle" version="1.8.3.1" targetFramework="net47" /> + <package id="BouncyCastle" version="1.8.6.1" targetFramework="net47" /> <package id="CairoSharp" version="3.22.25.74" targetFramework="net47" /> <package id="GdkSharp" version="3.22.25.74" targetFramework="net47" /> <package id="GioSharp" version="3.22.25.74" targetFramework="net47" /> <package id="GLibSharp" version="3.22.25.74" targetFramework="net47" /> - <package id="Google.Protobuf" version="3.6.1" targetFramework="net47" /> - <package id="GtkSharp" version="3.22.25.74" targetFramework="net47" /> + <package id="Google.Protobuf" version="3.12.0" targetFramework="net47" /> <package id="K4os.Compression.LZ4" version="1.1.11" targetFramework="net47" /> <package id="K4os.Compression.LZ4.Streams" version="1.1.11" targetFramework="net47" /> <package id="K4os.Hash.xxHash" version="1.0.6" targetFramework="net47" /> @@ -30,7 +29,7 @@ <package id="Microsoft.Extensions.Primitives" version="3.1.4" targetFramework="net47" /> <package id="MySql.Data" version="8.0.20" targetFramework="net47" /> <package id="MySql.Data.EntityFrameworkCore" version="8.0.20" targetFramework="net47" /> - <package id="NUnit" version="2.6.4" targetFramework="net47" /> + <package id="NUnit" version="3.12.0" targetFramework="net47" /> <package id="PangoSharp" version="3.22.25.74" targetFramework="net47" /> <package id="SSH.NET" version="2016.1.0" targetFramework="net47" /> <package id="System.Buffers" version="4.5.1" targetFramework="net47" /> |
