From 747aa00440eb9b219d989a536b0ff0c959b35143 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 22 May 2020 12:59:32 +0300 Subject: 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). --- .../ServiceTests/GameEventLogControllerTests.cs | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 MundusTests/ServiceTests/GameEventLogControllerTests.cs (limited to 'MundusTests/ServiceTests/GameEventLogControllerTests.cs') 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()); + } + } +} -- cgit v1.2.3