From d580ea82d48831e3cf243e5b250bf7076c8a6b1b Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 19 May 2020 13:29:09 +0300 Subject: Added final data test (that I didn't think I could do) --- MundusTests/DataTests/Mobs/MITests.cs | 27 +++++++++++++++++++ MundusTests/MundusTests.csproj | 16 +++++++----- .../SuperLayers/HeightControllerTests.cs | 30 ++++++++++++++++++++++ MundusTests/packages.config | 7 +++-- 4 files changed, 69 insertions(+), 11 deletions(-) create mode 100644 MundusTests/DataTests/Mobs/MITests.cs create mode 100644 MundusTests/ServiceTests/SuperLayers/HeightControllerTests.cs (limited to 'MundusTests') 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 @@ + Debug AnyCPU @@ -27,7 +28,7 @@ - ..\packages\NUnit.2.6.4\lib\nunit.framework.dll + ..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll ..\packages\Microsoft.Bcl.HashCode.1.1.0\lib\net461\Microsoft.Bcl.HashCode.dll @@ -120,9 +121,6 @@ ..\packages\GdkSharp.3.22.25.74\lib\netstandard2.0\GdkSharp.dll - - ..\packages\GtkSharp.3.22.25.74\lib\netstandard2.0\GtkSharp.dll - @@ -130,10 +128,10 @@ ..\packages\Microsoft.EntityFrameworkCore.Relational.3.1.4\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Relational.dll - ..\packages\BouncyCastle.1.8.3.1\lib\BouncyCastle.Crypto.dll + ..\packages\BouncyCastle.1.8.6.1\lib\BouncyCastle.Crypto.dll - ..\packages\Google.Protobuf.3.6.1\lib\net45\Google.Protobuf.dll + ..\packages\Google.Protobuf.3.12.0\lib\net45\Google.Protobuf.dll ..\packages\SSH.NET.2016.1.0\lib\net40\Renci.SshNet.dll @@ -187,6 +185,8 @@ + + @@ -197,6 +197,9 @@ + + + @@ -205,5 +208,4 @@ - \ 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 @@  - + - - + @@ -30,7 +29,7 @@ - + -- cgit v1.2.3