1
0
mirror of https://github.com/ZetaKebab/MpcNET.git synced 2025-07-18 05:27:37 +00:00

Major refactoring

This commit is contained in:
Kim Hugener-Ohlsen
2018-05-18 15:14:20 +02:00
parent 245efd6477
commit 12ddc4bca4
99 changed files with 426 additions and 419 deletions

View File

@ -1,25 +1,25 @@
using System;
using System.Net;
using System.Threading.Tasks;
namespace MpcNET.Test
{
using System;
using System.Net;
using System.Threading.Tasks;
public class MpcMock : IDisposable
{
public MpcMock()
{
var mpdEndpoint = new IPEndPoint(IPAddress.Loopback, 6600);
Client = new Mpc(mpdEndpoint);
this.Client = new MpcConnection(mpdEndpoint);
var connected = Task.Run(async () => await Client.ConnectAsync()).Result;
TestOutput.WriteLine($"Connected to MPD : {connected}; Version: {Client.Version}");
Task.Run(async () => await this.Client.ConnectAsync()).Wait();
TestOutput.WriteLine($"Connected to MPD Version: {this.Client.Version}");
}
public Mpc Client { get; }
public MpcConnection Client { get; }
public void Dispose()
{
Client?.DisconnectAsync().GetAwaiter().GetResult();
this.Client?.DisconnectAsync().GetAwaiter().GetResult();
TestOutput.WriteLine($"Disconnected from MPD.");
}
}