mirror of
https://github.com/ZetaKebab/MpcNET.git
synced 2025-01-14 22:18:43 +00:00
Trigger travis to run tests. Sample test implemented.
This commit is contained in:
parent
d45aff33ee
commit
2880ce2e46
@ -4,6 +4,6 @@ sudo: required
|
||||
mono: none
|
||||
dotnet: 1.0.0-preview2-003131
|
||||
script:
|
||||
- dotnet restore && dotnet build **/project.json
|
||||
- dotnet restore && dotnet build **/project.json && dotnet test LibMpcTest\project.json
|
||||
notifications:
|
||||
email:false
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
@ -11,6 +12,7 @@ namespace LibMpc
|
||||
IMpdResponse<T> Response { get; }
|
||||
}
|
||||
|
||||
[DebuggerDisplay("Request: {Request.Command.Value} | Response Status: {Response.State.Status}")]
|
||||
public class MpdMessage<T> : IMpdMessage<T>
|
||||
{
|
||||
private readonly Regex _linePattern = new Regex("^(?<key>[A-Za-z_]*):[ ]{0,1}(?<value>.*)$");
|
||||
|
@ -1,9 +1,9 @@
|
||||
using LibMpc;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
@ -30,6 +30,17 @@ namespace LibMpcTest
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ListAllTest()
|
||||
{
|
||||
var response = await _mpc.SendAsync(new Commands.Reflection.TagTypes());
|
||||
|
||||
_output.WriteLine(JsonConvert.SerializeObject(response, Formatting.Indented));
|
||||
|
||||
Assert.True(response.Response.Body.Keys.Contains("tagtypes"));
|
||||
Assert.True(response.Response.Body.Values.Any());
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_mpc?.DisconnectAsync().GetAwaiter().GetResult();
|
||||
|
Loading…
Reference in New Issue
Block a user