mirror of
https://github.com/ZetaKebab/MpcNET.git
synced 2025-07-02 09:07:38 +00:00
Output commands completed + test
This commit is contained in:
@ -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));
|
||||
}
|
||||
|
Reference in New Issue
Block a user