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