mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
50 lines
1.1 KiB
C#
50 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Squirrel.SimpleSplat;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Squirrel.Tests
|
|
{
|
|
public interface ITestLogging
|
|
{
|
|
IFullLogger Log();
|
|
}
|
|
|
|
public class TestLogger : ILogger
|
|
{
|
|
public LogLevel Level { get; set; }
|
|
public ITestOutputHelper OutputHelper { get; }
|
|
|
|
public TestLogger(ITestOutputHelper outputHelper)
|
|
{
|
|
OutputHelper = outputHelper;
|
|
}
|
|
|
|
public void Write([Localizable(false)] string message, LogLevel logLevel)
|
|
{
|
|
OutputHelper.WriteLine(message);
|
|
}
|
|
}
|
|
|
|
public abstract class TestLoggingBase : ITestLogging
|
|
{
|
|
public ITestOutputHelper OutputHelper { get; }
|
|
public IFullLogger Logger { get; }
|
|
|
|
public TestLoggingBase(ITestOutputHelper log)
|
|
{
|
|
OutputHelper = log;
|
|
Logger = new WrappingFullLogger(new TestLogger(OutputHelper), typeof(TestLogger));
|
|
}
|
|
|
|
public IFullLogger Log()
|
|
{
|
|
return Logger;
|
|
}
|
|
}
|
|
}
|