35 lines
980 B
C#
35 lines
980 B
C#
using Bunny.Service.IService.Service;
|
|
using Bunny.WebApi.Controllers;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using NUnit.Framework;
|
|
using Xunit;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Bunny.Test.Until.Redis;
|
|
|
|
[TestFixture]
|
|
public class RedisConnect
|
|
{
|
|
private readonly ITestOutputHelper _testOutputHelper;
|
|
private readonly ServiceProvider _provider;
|
|
|
|
|
|
public RedisConnect(ITestOutputHelper testOutputHelper)
|
|
{
|
|
_testOutputHelper = testOutputHelper;
|
|
var serviceCollection = new ServiceCollection();
|
|
serviceCollection.AddLogging();
|
|
serviceCollection.AddTransient<TemplateController>();
|
|
_provider = serviceCollection.BuildServiceProvider();
|
|
}
|
|
|
|
[Fact]
|
|
public void RedisConnectTest()
|
|
{
|
|
var baseService = new BaseService();
|
|
var testIndex = baseService.TestIndex();
|
|
_testOutputHelper.WriteLine(testIndex);
|
|
|
|
var controller = _provider.GetService<TemplateController>();
|
|
}
|
|
} |