aboutsummaryrefslogtreecommitdiff
path: root/MundusTests/ServiceTests/GameEventLogControllerTests.cs
blob: bed1ef9d7f479182be648e18baef3045e09225d0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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());
        }
    }
}