aurora/Aurora.test/ControllerTests/PartyControllerTest.cs

37 lines
1.1 KiB
C#
Raw Normal View History

using System.Threading.Tasks;
2020-01-20 23:38:05 +00:00
using NUnit.Framework;
using Aurora.Proto.PartyV2;
using Aurora.Services.Server;
using Grpc.Core;
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;
[SetUp]
public void Setup()
{
ServerService.Instance.Start("testParty", "asdf");
_channel = new Channel(string.Format("{0}:{1}", ServerService.GetLocalIPAddress(), 8080), ChannelCredentials.Insecure);
_remotePartyService = new RemotePartyService.RemotePartyServiceClient(_channel);
}
[TearDown]
public async Task TearDown()
{
await ServerService.Instance.Stop();
await _channel.ShutdownAsync();
}
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
}
}
}