mirror of
https://github.com/ZetaKebab/MpcNET.git
synced 2025-07-18 05:27:37 +00:00
Rewrote most of the library
This commit is contained in:
26
Sources/MpcNET.Test/MpcMock.cs
Normal file
26
Sources/MpcNET.Test/MpcMock.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MpcNET.Test
|
||||
{
|
||||
public class MpcMock : IDisposable
|
||||
{
|
||||
public MpcMock()
|
||||
{
|
||||
var mpdEndpoint = new IPEndPoint(IPAddress.Loopback, 6600);
|
||||
Client = new Mpc(mpdEndpoint);
|
||||
|
||||
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.");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user