Files
btcpayserver/BTCPayServer.Tests/UnitTestBase.cs
2021-11-23 12:53:05 +09:00

39 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using BTCPayServer.Tests.Logging;
using Xunit.Abstractions;
namespace BTCPayServer.Tests
{
public class UnitTestBase
{
public UnitTestBase(ITestOutputHelper helper)
{
TestLogs = new XUnitLog(helper) { Name = "Tests" };
TestLogProvider = new XUnitLogProvider(helper);
Logs.Tester = TestLogs;
Logs.LogProvider = TestLogProvider;
}
public ILog TestLogs
{
get;
}
public XUnitLogProvider TestLogProvider
{
get;
}
public ServerTester CreateServerTester([CallerMemberNameAttribute] string scope = null, bool newDb = false)
{
return new ServerTester(scope, newDb);
}
public SeleniumTester CreateSeleniumTester([CallerMemberNameAttribute] string scope = null, bool newDb = false)
{
return new SeleniumTester() { Server = new ServerTester(scope, newDb) };
}
}
}