aboutsummaryrefslogtreecommitdiff
path: root/MundusTests/ServiceTests/GameEventLogControllerTests.cs
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2020-05-22 12:59:32 +0300
committerSyndamia <kamen.d.mladenov@protonmail.com>2020-05-22 12:59:32 +0300
commit747aa00440eb9b219d989a536b0ff0c959b35143 (patch)
treef8b866f8e95c4597cae6b246746c23967e03def6 /MundusTests/ServiceTests/GameEventLogControllerTests.cs
parenta4e2f6753c6c2612444847fd12f1e973a86a4aa4 (diff)
downloadMundus-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/GameEventLogControllerTests.cs')
-rw-r--r--MundusTests/ServiceTests/GameEventLogControllerTests.cs35
1 files changed, 35 insertions, 0 deletions
diff --git a/MundusTests/ServiceTests/GameEventLogControllerTests.cs b/MundusTests/ServiceTests/GameEventLogControllerTests.cs
new file mode 100644
index 0000000..bed1ef9
--- /dev/null
+++ b/MundusTests/ServiceTests/GameEventLogControllerTests.cs
@@ -0,0 +1,35 @@
+namespace MundusTests.ServiceTests
+{
+ using System.Linq;
+ using Mundus.Data;
+ using Mundus.Service;
+ using NUnit.Framework;
+
+ [TestFixture]
+ public static class GameEventLogControllerTests
+ {
+ [Test]
+ [TestCase("Testing")]
+ public static void AddsCorrectlyMessages(string message)
+ {
+ GameEventLogController.AddMessage(message);
+
+ Assert.AreEqual(message, DataBaseContexts.GELContext.GameEventLogs.Single(x => x.ID == DataBaseContexts.GELContext.GameEventLogs.Count()).Message);
+ }
+
+ [Test]
+ [TestCase("Testing1")]
+ public static void GetsCorrectlyMessage(string message)
+ {
+ GameEventLogController.AddMessage(message);
+
+ Assert.AreEqual(message, GameEventLogController.GetMessagage(GameEventLogController.GetCount() - 1));
+ }
+
+ [Test]
+ public static void GetsCorrectCount()
+ {
+ Assert.AreEqual(DataBaseContexts.GELContext.GetCount(), GameEventLogController.GetCount());
+ }
+ }
+}