using Capnp.Rpc; using FabAccessAPI; using NUnit.Framework; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace FabAccessAPI_Test { public class Connection_Test { [TestCase("test.fab-access.org", 59661)] public async Task Connect(string host, int port) { TcpRpcClient tcpRpcClient = new TcpRpcClient(); tcpRpcClient.Connect(host, port); await tcpRpcClient.WhenConnected; Connection connection = new Connection(tcpRpcClient); } [TestCase("test.fab-access.org", 59661, "Testuser", "secret")] public async Task Authenticate_PLAIN(string host, int port, string username, string password) { TcpRpcClient tcpRpcClient = new TcpRpcClient(); tcpRpcClient.Connect(host, port); await tcpRpcClient.WhenConnected; Connection connection = new Connection(tcpRpcClient); await connection.Auth("PLAIN", new Dictionary(StringComparer.Ordinal) { { "Username", username }, { "Password", password } }); Assert.IsNotNull(connection.Session); } } }