-
Notifications
You must be signed in to change notification settings - Fork 96
/
NormalMessageTest.cs
37 lines (33 loc) · 1.04 KB
/
NormalMessageTest.cs
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
36
37
using System;
using Xunit;
using NSubstitute;
using UnityEngine;
using ModuleManager.Logging;
namespace ModuleManagerTests.Logging
{
public class NormalMessageTest
{
private IBasicLogger logger = Substitute.For<IBasicLogger>();
[Fact]
public void TestLogTo__Info()
{
NormalMessage message = new NormalMessage(LogType.Log, "everything is ok");
message.LogTo(logger);
logger.Received().Log(LogType.Log, "everything is ok");
}
[Fact]
public void TestLogTo__Warning()
{
NormalMessage message = new NormalMessage(LogType.Warning, "I'm warning you");
message.LogTo(logger);
logger.Received().Log(LogType.Warning, "I'm warning you");
}
[Fact]
public void TestLogTo__Error()
{
NormalMessage message = new NormalMessage(LogType.Error, "You went too far");
message.LogTo(logger);
logger.Received().Log(LogType.Error, "You went too far");
}
}
}