2021-02-04 03:48:30 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Threading.Tasks;
|
2021-05-17 22:37:01 +00:00
|
|
|
|
using Wabbajack.Common;
|
2021-02-04 03:48:30 +00:00
|
|
|
|
using Wabbajack.Lib;
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace Wabbajack.Test
|
|
|
|
|
{
|
|
|
|
|
public class MetricsTests
|
|
|
|
|
{
|
|
|
|
|
[Fact]
|
|
|
|
|
public async Task CanSendExceptions()
|
|
|
|
|
{
|
2021-05-17 22:37:01 +00:00
|
|
|
|
foreach (var mode in new[] {true, false})
|
2021-02-04 03:48:30 +00:00
|
|
|
|
{
|
2021-05-17 22:37:01 +00:00
|
|
|
|
Consts.UseNetworkWorkaroundMode = mode;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
throw new Exception("Test Exception");
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
await Metrics.Error(this.GetType(), ex);
|
|
|
|
|
}
|
2021-02-04 03:48:30 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|