diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2020-05-22 12:59:32 +0300 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2020-05-22 12:59:32 +0300 |
| commit | 747aa00440eb9b219d989a536b0ff0c959b35143 (patch) | |
| tree | f8b866f8e95c4597cae6b246746c23967e03def6 /MundusTests/ServiceTests/Tiles/Mobs/MobTileTests.cs | |
| parent | a4e2f6753c6c2612444847fd12f1e973a86a4aa4 (diff) | |
| download | Mundus-747aa00440eb9b219d989a536b0ff0c959b35143.tar Mundus-747aa00440eb9b219d989a536b0ff0c959b35143.tar.gz Mundus-747aa00440eb9b219d989a536b0ff0c959b35143.zip | |
Completed all tests (there is still some code that can be tested, but it will be very hard to do so and I am skipping it for now).
Diffstat (limited to 'MundusTests/ServiceTests/Tiles/Mobs/MobTileTests.cs')
| -rw-r--r-- | MundusTests/ServiceTests/Tiles/Mobs/MobTileTests.cs | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/MundusTests/ServiceTests/Tiles/Mobs/MobTileTests.cs b/MundusTests/ServiceTests/Tiles/Mobs/MobTileTests.cs index b91877c..a4329dc 100644 --- a/MundusTests/ServiceTests/Tiles/Mobs/MobTileTests.cs +++ b/MundusTests/ServiceTests/Tiles/Mobs/MobTileTests.cs @@ -1,15 +1,17 @@ -using System; -using Mundus.Data; -using Mundus.Data.Windows; -using Mundus.Service.Tiles.Items.Types; -using Mundus.Service.Tiles.Mobs; -using NUnit.Framework; - -namespace MundusTests.ServiceTests.Tiles.Mobs { +namespace MundusTests.ServiceTests.Tiles.Mobs +{ + using Mundus.Data; + using Mundus.Data.Windows; + using Mundus.Service.Tiles.Items.Types; + using Mundus.Service.Tiles.Mobs; + using NUnit.Framework; + [TestFixture] - public static class MobTileTests { + public static class MobTileTests + { [Test] - public static void InstantiatesProperly() { + public static void InstantiatesProperly() + { MobTile mob = new MobTile("test", 10, 3, DataBaseContexts.SContext, 7, new Material("test_material"), 9); Assert.AreEqual("test", mob.stock_id); @@ -24,7 +26,8 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [Test] [TestCase(10, 3)] [TestCase(19, 11)] - public static void AliveAfterTakingSmallDamage(int health, int damage) { + public static void AliveAfterTakingSmallDamage(int health, int damage) + { MobTile mob = new MobTile("test", health, 3, DataBaseContexts.SContext); Assert.IsTrue(mob.TakeDamage(damage)); @@ -33,7 +36,8 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [Test] [TestCase(10, 10)] [TestCase(13, 20)] - public static void DeadAfterTakingBigDamage(int health, int damage) { + public static void DeadAfterTakingBigDamage(int health, int damage) + { MobTile mob = new MobTile("test", health, 3, DataBaseContexts.SContext); Assert.IsFalse(mob.TakeDamage(damage)); @@ -42,19 +46,20 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [Test] [TestCase(10, 10)] [TestCase(13, 20)] - public static void HealsProperly(int health, int healByPoints) { + public static void HealsProperly(int health, int healByPoints) + { MobTile mob = new MobTile("test", health, 3, DataBaseContexts.SContext); mob.Heal(healByPoints); - if (health + healByPoints > WI.SelWin.Size * 4) { + if (health + healByPoints > WI.SelWin.Size * 4) + { Assert.AreEqual(WI.SelWin.Size, mob.Health); } - else { - + else + { Assert.AreEqual(health + healByPoints, mob.Health); } - } } } |
