1
0
mirror of https://github.com/ZetaKebab/MpcNET.git synced 2025-07-03 01:17:36 +00:00

Updates from latest Stylophone code

This commit is contained in:
Difegue
2021-10-03 17:53:58 +02:00
parent 6ee33cd704
commit 6c473b01b7
85 changed files with 2395 additions and 952 deletions

View File

@ -4,6 +4,7 @@
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MpcNET.Commands;
using MpcNET.Commands.Queue;
public partial class LibMpcTest
{
@ -117,7 +118,7 @@
private async Task Check_Empty_Queue()
{
var message = await Mpc.SendAsync(new Commands.Playlist.PlaylistCommand());
var message = await Mpc.SendAsync(new PlaylistCommand());
Assert.IsTrue(message.HasSuccessResponse());
Assert.IsFalse(message.Response.Content.Any());
}
@ -130,44 +131,44 @@
private async Task Clear_Queue()
{
var message = await Mpc.SendAsync(new Commands.Playlist.ClearCommand());
var message = await Mpc.SendAsync(new ClearCommand());
Assert.IsTrue(message.HasSuccessResponse());
}
private async Task Check_Queue_HasSongs(int nrOfSongs)
{
var message = await Mpc.SendAsync(new Commands.Playlist.PlaylistCommand());
var message = await Mpc.SendAsync(new PlaylistCommand());
Assert.IsTrue(message.HasSuccessResponse());
Assert.IsTrue(message.Response.Content.Count() == nrOfSongs);
}
private async Task Add_Directory(string directory)
{
var message = await Mpc.SendAsync(new Commands.Playlist.AddCommand(directory));
var message = await Mpc.SendAsync(new AddCommand(directory));
Assert.IsTrue(message.HasSuccessResponse());
}
private async Task Add_File(string file)
{
var message = await Mpc.SendAsync(new Commands.Playlist.AddIdCommand(file));
var message = await Mpc.SendAsync(new AddIdCommand(file));
Assert.IsTrue(message.HasSuccessResponse());
}
private async Task Remove_Position(int position)
{
var message = await Mpc.SendAsync(new Commands.Playlist.DeleteCommand(position));
var message = await Mpc.SendAsync(new DeleteCommand(position));
Assert.IsTrue(message.HasSuccessResponse());
}
private async Task Remove_Id(int songId)
{
var message = await Mpc.SendAsync(new Commands.Playlist.DeleteIdCommand(songId));
var message = await Mpc.SendAsync(new DeleteIdCommand(songId));
Assert.IsTrue(message.HasSuccessResponse());
}
private async Task<int> Get_Song_Id()
{
var message = await Mpc.SendAsync(new Commands.Playlist.PlaylistInfoCommand());
var message = await Mpc.SendAsync(new PlaylistInfoCommand());
return message.Response.Content.Single().Id;
}
}

View File

@ -33,7 +33,7 @@ namespace MpcNET.Test
TestOutput.WriteLine("TagTypesTest Result:");
TestOutput.WriteLine(response);
Assert.IsTrue(response.Response.Content.Count().Equals(17));
Assert.IsTrue(response.Response.Content.Count().Equals(25));
}
[TestMethod]
@ -47,9 +47,7 @@ namespace MpcNET.Test
// Different answer from MPD on Windows and on Linux.
// Check some of the handlers.
Assert.IsTrue(response.Response.Content.Any(handler => handler.Equals("http://")));
Assert.IsTrue(response.Response.Content.Any(handler => handler.Equals("mms://")));
Assert.IsTrue(response.Response.Content.Any(handler => handler.Equals("gopher://")));
Assert.IsTrue(response.Response.Content.Any(handler => handler.Equals("rtp://")));
Assert.IsTrue(response.Response.Content.Any(handler => handler.Equals("nfs://")));
}
[TestMethod]
@ -62,7 +60,7 @@ namespace MpcNET.Test
// Different answer from MPD on Windows and on Linux.
// Check some of the decoders.
Assert.IsTrue(response.Response.Content.Any(decoder => decoder.Name.Equals("mad")));
Assert.IsTrue(response.Response.Content.Any(decoder => decoder.Name.Equals("vorbis")));
Assert.IsTrue(response.Response.Content.Any(decoder => decoder.Suffixes.Any(suffix => suffix.Equals("mp3"))));
Assert.IsTrue(response.Response.Content.Any(decoder => decoder.MediaTypes.Any(mediaType => mediaType.Equals("audio/mpeg"))));
Assert.IsTrue(response.Response.Content.Any(decoder => decoder.Name.Equals("flac")));