mirror of
https://github.com/ZetaKebab/MpcNET.git
synced 2025-01-14 22:18:43 +00:00
26 lines
689 B
C#
26 lines
689 B
C#
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;
|
|
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.");
|
|
}
|
|
}
|
|
} |