2016-12-20 09:46:40 +00:00
|
|
|
using LibMpc;
|
|
|
|
using System;
|
|
|
|
using System.Net;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
namespace LibMpcTest
|
|
|
|
{
|
|
|
|
public class MpcMock : IDisposable
|
|
|
|
{
|
|
|
|
public MpcMock()
|
|
|
|
{
|
|
|
|
Client = new Mpc(new IPEndPoint(IPAddress.Loopback, 6600));
|
|
|
|
|
|
|
|
var connected = Task.Run(async () => await Client.ConnectAsync()).Result;
|
2016-12-20 10:31:48 +00:00
|
|
|
TestOutput.WriteLine($"Connected to MPD : {connected}; Version: {Client.Version}");
|
2016-12-20 09:46:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public Mpc Client { get; }
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
{
|
|
|
|
Client?.DisconnectAsync().GetAwaiter().GetResult();
|
2016-12-20 10:03:28 +00:00
|
|
|
TestOutput.WriteLine($"Disconnected from MPD.");
|
2016-12-20 09:46:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|