This repository has been archived on 2020-12-20. You can view files and clone it, but cannot push or open issues or pull requests.
aurora-sharp-desktop/Aurora.test/ControllerTests/PartyControllerTest.cs

53 lines
1.3 KiB
C#
Raw Permalink Normal View History

using System.Threading.Tasks;
2020-01-20 23:38:05 +00:00
using NUnit.Framework;
using Aurora.Proto.Party;
2020-01-20 23:38:05 +00:00
using Aurora.Services.Server;
using Grpc.Core;
using Autofac;
2020-01-20 23:38:05 +00:00
namespace Aurora.test.ControllerTests
2020-01-20 23:38:05 +00:00
{
public class PartyControllerTests
2020-01-20 23:38:05 +00:00
{
private RemotePartyService.RemotePartyServiceClient _remotePartyService;
private Channel _channel;
private IContainer _container;
private IServerService _serverService;
#region Setup
[OneTimeSetUp]
public void SetupOneTime()
{
_container = SetupUtil.SetupOneTime();
}
[OneTimeTearDown]
public void TearDownOneTime()
{
_container.Dispose();
}
2020-01-20 23:38:05 +00:00
[SetUp]
public void Setup()
{
_remotePartyService = SetupUtil.Setup(ref _container, ref _serverService, ref _channel);
2020-01-20 23:38:05 +00:00
}
[TearDown]
public async Task TearDown()
{
await _serverService.Stop();
await _channel.ShutdownAsync();
}
#endregion Setup
2020-01-20 23:38:05 +00:00
[Test]
public void DefaultTest()
2020-01-20 23:38:05 +00:00
{
Party party = _remotePartyService.GetParty(new Proto.General.Empty());
Assert.NotNull(party);
Assert.AreEqual(party.Name, "party/party1");
2020-01-20 23:38:05 +00:00
}
}
}