mirror of
https://github.com/ZetaKebab/MpcNET.git
synced 2025-01-14 22:18:43 +00:00
26 lines
715 B
C#
26 lines
715 B
C#
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);
|
|
this.Client = new MpcConnection(mpdEndpoint);
|
|
|
|
Task.Run(async () => await this.Client.ConnectAsync()).Wait();
|
|
TestOutput.WriteLine($"Connected to MPD Version: {this.Client.Version}");
|
|
}
|
|
|
|
public MpcConnection Client { get; }
|
|
|
|
public void Dispose()
|
|
{
|
|
this.Client?.DisconnectAsync().GetAwaiter().GetResult();
|
|
TestOutput.WriteLine($"Disconnected from MPD.");
|
|
}
|
|
}
|
|
} |