From a4e2f6753c6c2612444847fd12f1e973a86a4aa4 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 20 May 2020 13:12:31 +0300 Subject: Fixed test SetUps and TearDowns. Did tests for Inventory and MobTile (Service/Mobs). Did some minor changes to the program. --- .../ServiceTests/SuperLayers/HeightControllerTests.cs | 11 +++-------- .../ServiceTests/SuperLayers/ImageControllerTests.cs | 16 +--------------- 2 files changed, 4 insertions(+), 23 deletions(-) (limited to 'MundusTests/ServiceTests/SuperLayers') diff --git a/MundusTests/ServiceTests/SuperLayers/HeightControllerTests.cs b/MundusTests/ServiceTests/SuperLayers/HeightControllerTests.cs index 70a2d02..88aa4aa 100644 --- a/MundusTests/ServiceTests/SuperLayers/HeightControllerTests.cs +++ b/MundusTests/ServiceTests/SuperLayers/HeightControllerTests.cs @@ -6,24 +6,19 @@ [TestFixture] public static class HeightControllerTests - { - [OneTimeSetUp] - public static void SetUp() { - DataBaseContexts.CreateInstances(); - } - + { [Test] public static void GetsCorrectSuperLayerUnderneath() { 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"); + Assert.IsNull(HeightController.GetSuperLayerUnderneath(DataBaseContexts.UContext), "GetSuperLayerUnderneath doesn't return that there is nothing (null) below underground"); } [Test] public static void GetsCorrectSuperLayerAbove() { - Assert.AreEqual(null, HeightController.GetSuperLayerAbove(DataBaseContexts.SContext), "GetSuperLayerUnderneath doesn't return that there is nothing (null) above sky"); + Assert.IsNull(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/ServiceTests/SuperLayers/ImageControllerTests.cs b/MundusTests/ServiceTests/SuperLayers/ImageControllerTests.cs index c8d8e06..9ab6418 100644 --- a/MundusTests/ServiceTests/SuperLayers/ImageControllerTests.cs +++ b/MundusTests/ServiceTests/SuperLayers/ImageControllerTests.cs @@ -12,25 +12,11 @@ [TestFixture] public static class ImageControllerTests { - [OneTimeSetUp] - public static void SetUp() - { - Application.Init(); - DataBaseContexts.CreateInstances(); - WI.CreateInstances(); - WI.WNewGame.OnBtnGenerateClicked(null, null); - } - - [OneTimeTearDown] - public static void TearDown() - { - Application.Quit(); - } [Test] [TestCase(1, 5)] [TestCase(2, 2)] - [TestCase(8, 11)] + [TestCase(8, 10)] public static void GetsCorrectGroundImage(int yPos, int xPos) { Image img = null; -- cgit v1.2.3