Initial commit

This commit is contained in:
Gregory Campbell
2019-09-29 19:40:54 -04:00
commit 463a783c7c
3583 changed files with 101769 additions and 0 deletions
@@ -0,0 +1,43 @@
using System.Text.RegularExpressions;
using UnityEngine.TestTools.Logging;
using UnityEngine.TestTools.TestRunner;
namespace UnityEngine.TestTools
{
public static class LogAssert
{
public static void Expect(LogType type, string message)
{
LogScope.Current.ExpectedLogs.Enqueue(new LogMatch() { LogType = type, Message = message });
}
public static void Expect(LogType type, Regex message)
{
LogScope.Current.ExpectedLogs.Enqueue(new LogMatch() { LogType = type, MessageRegex = message });
}
public static void NoUnexpectedReceived()
{
LogScope.Current.ProcessExpectedLogs();
var isAllLogsHandled = LogScope.Current.IsAllLogsHandled();
if (isAllLogsHandled)
{
return;
}
var unhandledLog = LogScope.Current.GetUnhandledLog();
throw new UnhandledLogMessageException(unhandledLog);
}
public static bool ignoreFailingMessages
{
get
{
return LogScope.Current.IgnoreFailingMessages;
}
set
{
LogScope.Current.IgnoreFailingMessages = value;
}
}
}
}