mirror of
https://github.com/ZetaKebab/MpcNET.git
synced 2025-01-14 22:18:43 +00:00
"Commands" command created and tested
This commit is contained in:
parent
b7791ab26a
commit
36a4888789
@ -11,7 +11,22 @@ namespace LibMpc
|
||||
public static class Reflection
|
||||
{
|
||||
// TODO: config
|
||||
// TODO: commands
|
||||
|
||||
/// <summary>
|
||||
/// Shows which commands the current user has access to.
|
||||
/// </summary>
|
||||
public class Commands : IMpcCommand<IEnumerable<string>>
|
||||
{
|
||||
public string Value => "commands";
|
||||
|
||||
public IEnumerable<string> FormatResponse(IList<KeyValuePair<string, string>> response)
|
||||
{
|
||||
var result = response.Where(item => item.Key.Equals("command")).Select(item => item.Value);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: notcommands
|
||||
|
||||
public class TagTypes : IMpcCommand<IEnumerable<string>>
|
||||
|
@ -8,6 +8,17 @@ namespace LibMpcTest
|
||||
{
|
||||
public partial class LibMpcTest
|
||||
{
|
||||
[Fact]
|
||||
public async Task CommandsTest()
|
||||
{
|
||||
var response = await Mpc.SendAsync(new Commands.Reflection.Commands());
|
||||
|
||||
TestOutput.WriteLine($"CommandsTest (commands: {response.Response.Body.Count()}) Result:");
|
||||
TestOutput.WriteLine(JsonConvert.SerializeObject(response, Formatting.Indented));
|
||||
|
||||
Assert.True(response.Response.Body.Count().Equals(84));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TagTypesTest()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user