mirror of
https://github.com/ZetaKebab/MpcNET.git
synced 2025-07-01 08:47:36 +00:00
Output commands completed + test
This commit is contained in:
@ -13,8 +13,8 @@ namespace LibMpcTest
|
||||
{
|
||||
var response = await Mpc.SendAsync(new Commands.Database.ListAll());
|
||||
|
||||
TestUtils.WriteLine("ListAllTest Result:");
|
||||
TestUtils.WriteLine(JsonConvert.SerializeObject(response, Formatting.Indented));
|
||||
TestOutput.WriteLine("ListAllTest Result:");
|
||||
TestOutput.WriteLine(JsonConvert.SerializeObject(response, Formatting.Indented));
|
||||
|
||||
Assert.True(response.Response.Body.Count().Equals(7));
|
||||
}
|
||||
@ -24,8 +24,8 @@ namespace LibMpcTest
|
||||
{
|
||||
var response = await Mpc.SendAsync(new Commands.Database.Find(MpdTags.Genre, "soundfx"));
|
||||
|
||||
TestUtils.WriteLine("FindGenreTest Result:");
|
||||
TestUtils.WriteLine(JsonConvert.SerializeObject(response, Formatting.Indented));
|
||||
TestOutput.WriteLine("FindGenreTest Result:");
|
||||
TestOutput.WriteLine(JsonConvert.SerializeObject(response, Formatting.Indented));
|
||||
|
||||
Assert.True(response.Response.Body.Count().Equals(6));
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ namespace LibMpcTest
|
||||
|
||||
var response = await Mpc.SendAsync(new Commands.Output.DisableOutput(2));
|
||||
|
||||
TestUtils.WriteLine("DisableOutputTest Result:");
|
||||
TestUtils.WriteLine(JsonConvert.SerializeObject(response, Formatting.Indented));
|
||||
TestOutput.WriteLine("DisableOutputTest Result:");
|
||||
TestOutput.WriteLine(JsonConvert.SerializeObject(response, Formatting.Indented));
|
||||
|
||||
Assert.True(response.Response.Body.Equals(string.Empty));
|
||||
Assert.True(response.Response.State.Status.Equals("OK"));
|
||||
@ -35,8 +35,8 @@ namespace LibMpcTest
|
||||
|
||||
var response = await Mpc.SendAsync(new Commands.Output.EnableOutput(1));
|
||||
|
||||
TestUtils.WriteLine("EnableOutputTest Result:");
|
||||
TestUtils.WriteLine(JsonConvert.SerializeObject(response, Formatting.Indented));
|
||||
TestOutput.WriteLine("EnableOutputTest Result:");
|
||||
TestOutput.WriteLine(JsonConvert.SerializeObject(response, Formatting.Indented));
|
||||
|
||||
Assert.True(response.Response.Body.Equals(string.Empty));
|
||||
Assert.True(response.Response.State.Status.Equals("OK"));
|
||||
@ -45,13 +45,31 @@ namespace LibMpcTest
|
||||
Assert.True(responseOutputs.Response.Body.Single(output => output.Id.Equals(1)).IsEnabled);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ToggleOutputTest()
|
||||
{
|
||||
var responseOutputs = await Mpc.SendAsync(new Commands.Output.Outputs());
|
||||
Assert.True(responseOutputs.Response.Body.Single(output => output.Id.Equals(2)).IsEnabled);
|
||||
|
||||
var response = await Mpc.SendAsync(new Commands.Output.ToggleOutput(2));
|
||||
|
||||
TestOutput.WriteLine("ToggleOutputTest Result:");
|
||||
TestOutput.WriteLine(JsonConvert.SerializeObject(response, Formatting.Indented));
|
||||
|
||||
Assert.True(response.Response.Body.Equals(string.Empty));
|
||||
Assert.True(response.Response.State.Status.Equals("OK"));
|
||||
|
||||
responseOutputs = await Mpc.SendAsync(new Commands.Output.Outputs());
|
||||
Assert.False(responseOutputs.Response.Body.Single(output => output.Id.Equals(2)).IsEnabled);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task LisOutputsTest()
|
||||
{
|
||||
var response = await Mpc.SendAsync(new Commands.Output.Outputs());
|
||||
|
||||
TestUtils.WriteLine("LisOutputsTest Result:");
|
||||
TestUtils.WriteLine(JsonConvert.SerializeObject(response, Formatting.Indented));
|
||||
TestOutput.WriteLine("LisOutputsTest Result:");
|
||||
TestOutput.WriteLine(JsonConvert.SerializeObject(response, Formatting.Indented));
|
||||
|
||||
Assert.True(response.Response.Body.Count().Equals(3));
|
||||
}
|
||||
|
@ -13,8 +13,8 @@ namespace LibMpcTest
|
||||
{
|
||||
var response = await Mpc.SendAsync(new Commands.Reflection.TagTypes());
|
||||
|
||||
TestUtils.WriteLine("TagTypesTest Result:");
|
||||
TestUtils.WriteLine(JsonConvert.SerializeObject(response, Formatting.Indented));
|
||||
TestOutput.WriteLine("TagTypesTest Result:");
|
||||
TestOutput.WriteLine(JsonConvert.SerializeObject(response, Formatting.Indented));
|
||||
|
||||
Assert.True(response.Response.Body.Count().Equals(17));
|
||||
}
|
||||
|
Reference in New Issue
Block a user