wabbajack/Wabbajack.App.Test/Startup.cs
2021-10-23 10:51:17 -06:00

31 lines
801 B
C#

using System.Collections.Generic;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Xunit.DependencyInjection;
using Xunit.DependencyInjection.Logging;
namespace Wabbajack.App.Test;
public class Startup
{
public void ConfigureServices(IServiceCollection service)
{
service.AddAppServices();
}
public void Configure(ILoggerFactory loggerFactory, ITestOutputHelperAccessor accessor)
{
loggerFactory.AddProvider(new XunitTestOutputLoggerProvider(accessor, delegate { return true; }));
MessageBus.Instance = new SimpleMessageBus();
}
}
public class SimpleMessageBus : IMessageBus
{
public List<object> Messages { get; } = new();
public void Send<T>(T message)
{
Messages.Add(message);
}
}