From ed2604f81b7ffe2291644b427813ba71363461d7 Mon Sep 17 00:00:00 2001 From: glucaci Date: Tue, 20 Dec 2016 12:04:59 +0100 Subject: [PATCH] UrlHandlersTest fixed --- LibMpcTest/Tests/ReflectionCommandsTest.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/LibMpcTest/Tests/ReflectionCommandsTest.cs b/LibMpcTest/Tests/ReflectionCommandsTest.cs index b24fcbe..2818489 100644 --- a/LibMpcTest/Tests/ReflectionCommandsTest.cs +++ b/LibMpcTest/Tests/ReflectionCommandsTest.cs @@ -17,8 +17,13 @@ namespace LibMpcTest TestOutput.WriteLine(JsonConvert.SerializeObject(response, Formatting.Indented)); // Different answer from MPD on Windows and on Linux, beacuse of Version. - // Check only if response is not empty - Assert.True(response.Response.Body.Any()); + // Check some of the commands. + Assert.True(response.Response.Body.Any(command => command.Equals("listall"))); + Assert.True(response.Response.Body.Any(command => command.Equals("outputs"))); + Assert.True(response.Response.Body.Any(command => command.Equals("pause"))); + Assert.True(response.Response.Body.Any(command => command.Equals("play"))); + Assert.True(response.Response.Body.Any(command => command.Equals("setvol"))); + Assert.True(response.Response.Body.Any(command => command.Equals("stop"))); } [Fact] @@ -40,7 +45,12 @@ namespace LibMpcTest TestOutput.WriteLine($"UrlHandlersTest (handlers: {response.Response.Body.Count()}) Result:"); TestOutput.WriteLine(JsonConvert.SerializeObject(response, Formatting.Indented)); - Assert.True(response.Response.Body.Count().Equals(11)); + // Different answer from MPD on Windows and on Linux. + // Check some of the handlers. + Assert.True(response.Response.Body.Any(handler => handler.Equals("http://"))); + Assert.True(response.Response.Body.Any(handler => handler.Equals("mms://"))); + Assert.True(response.Response.Body.Any(handler => handler.Equals("gopher://"))); + Assert.True(response.Response.Body.Any(handler => handler.Equals("rtp://"))); } } } \ No newline at end of file