diff --git a/SharpCaster.Console/SharpCaster.Console.csproj b/SharpCaster.Console/SharpCaster.Console.csproj index bd2f350..c2f3824 100644 --- a/SharpCaster.Console/SharpCaster.Console.csproj +++ b/SharpCaster.Console/SharpCaster.Console.csproj @@ -35,6 +35,10 @@ 4 + + ..\packages\Google.Protobuf.3.3.0\lib\net45\Google.Protobuf.dll + True + ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll True @@ -47,16 +51,8 @@ ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll True - - ..\packages\protobuf-net-sharpcaster.2.0.0.668\lib\portable46-net451+win81+wpa81\protobuf-net.dll - True - - - ..\packages\Rssdp.2.0.0.5\lib\net40\Rssdp.Native.dll - True - - - ..\packages\Rssdp.2.0.0.5\lib\net40\Rssdp.Portable.dll + + ..\packages\Rssdp.3.5.4\lib\net45\Rssdp.dll True diff --git a/SharpCaster.Console/packages.config b/SharpCaster.Console/packages.config index 8eea2cd..d8f8342 100644 --- a/SharpCaster.Console/packages.config +++ b/SharpCaster.Console/packages.config @@ -1,10 +1,10 @@  + - - + \ No newline at end of file diff --git a/SharpCaster.Simple.Android/SharpCaster.Simple.Android.csproj b/SharpCaster.Simple.Android/SharpCaster.Simple.Android.csproj index 193733f..5ec00d3 100644 --- a/SharpCaster.Simple.Android/SharpCaster.Simple.Android.csproj +++ b/SharpCaster.Simple.Android/SharpCaster.Simple.Android.csproj @@ -43,6 +43,10 @@ SdkOnly + + ..\packages\Google.Protobuf.3.3.0\lib\netstandard1.0\Google.Protobuf.dll + True + ..\packages\Microsoft.Bcl.Async.1.0.168\lib\portable-net45+win8+wpa81\Microsoft.Threading.Tasks.dll True @@ -53,12 +57,8 @@ - - ..\packages\Rssdp.2.0.0.5\lib\monoandroid\Rssdp.Native.dll - True - - - ..\packages\Rssdp.2.0.0.5\lib\monoandroid\Rssdp.Portable.dll + + ..\packages\Rssdp.3.5.4\lib\monoandroid\Rssdp.dll True diff --git a/SharpCaster.Simple.Android/packages.config b/SharpCaster.Simple.Android/packages.config index 5bd9493..1265cc7 100644 --- a/SharpCaster.Simple.Android/packages.config +++ b/SharpCaster.Simple.Android/packages.config @@ -1,9 +1,34 @@  + - + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SharpCaster.Simple/SharpCaster.Simple.nuget.targets b/SharpCaster.Simple/SharpCaster.Simple.nuget.targets index d3e86ea..ac12fe8 100644 --- a/SharpCaster.Simple/SharpCaster.Simple.nuget.targets +++ b/SharpCaster.Simple/SharpCaster.Simple.nuget.targets @@ -1,18 +1,9 @@  - - True - NuGet - C:\Users\habakker\Documents\Source\SharpCaster\SharpCaster.Simple\project.lock.json - $(UserProfile)\.nuget\packages\ - C:\Users\habakker\.nuget\packages\ - ProjectJson - 4.1.0 + + $(UserProfile)\.nuget\packages\ - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - + + \ No newline at end of file diff --git a/SharpCaster.Simple/project.json b/SharpCaster.Simple/project.json index 08cf21e..3a16ef1 100644 --- a/SharpCaster.Simple/project.json +++ b/SharpCaster.Simple/project.json @@ -1,13 +1,13 @@ { "dependencies": { - "Google.Protobuf": "3.2.0", + "Google.Protobuf": "3.3.0", "Microsoft.Bcl.Build": "1.0.21", "Microsoft.Net.Http": "2.2.29", - "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2", + "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.3", "Newtonsoft.Json": "9.0.1", - "protobuf-net-sharpcaster": "2.0.0.668", - "Rssdp": "2.0.0.5", - "sharpcaster.SocketsForPCL": "2.0.4" + "Rssdp": "3.5.4", + "sharpcaster.SocketsForPCL": "2.0.4", + "System.Xml.ReaderWriter": "4.3.0" }, "frameworks": { "uap10.0": {} diff --git a/SharpCaster.Test/ChromecastTester.cs b/SharpCaster.Test/ChromecastTester.cs index 213a22c..cb58fd2 100644 --- a/SharpCaster.Test/ChromecastTester.cs +++ b/SharpCaster.Test/ChromecastTester.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Linq; using SharpCaster.Controllers; using SharpCaster.Services; using Xunit; @@ -12,7 +8,7 @@ namespace SharpCaster.Test { public class ChromecastTester { - private ChromecastService _chromecastService; + private readonly ChromecastService _chromecastService; public ChromecastTester() { _chromecastService = ChromecastService.Current; diff --git a/SharpCaster.Test/DeviceLocatorTest.cs b/SharpCaster.Test/DeviceLocatorTest.cs index 07f3f6a..85d28e7 100644 --- a/SharpCaster.Test/DeviceLocatorTest.cs +++ b/SharpCaster.Test/DeviceLocatorTest.cs @@ -5,7 +5,7 @@ namespace SharpCaster.Test { public class DeviceLocatorTest { - private ChromecastService _chromecastService; + private readonly ChromecastService _chromecastService; public DeviceLocatorTest() { _chromecastService = ChromecastService.Current; diff --git a/SharpCaster.Test/ProtoBufTester.cs b/SharpCaster.Test/ProtoBufTester.cs index bfec627..ba8ea78 100644 --- a/SharpCaster.Test/ProtoBufTester.cs +++ b/SharpCaster.Test/ProtoBufTester.cs @@ -1,6 +1,4 @@ -using System.Linq; -using System.Text; -using Google.Protobuf; +using System.Text; using SharpCaster.Models; using Xunit; @@ -13,9 +11,7 @@ public void Connect_Should_Be_Serialized_Well() { var connectMessage = MessageFactory.Connect(); connectMessage.Namespace = "urn:x-cast:com.google.cast.tp.connection"; - var bytes = connectMessage.ToProto(); - var expectedBytes = new byte[] { 0, 0, 0, 88, 8, 0, 18, 8, 115, 101, 110, 100, 101, 114, 45, 48, 26, 10, 114, 101, 99, 101, 105, 118, @@ -23,7 +19,6 @@ public void Connect_Should_Be_Serialized_Well() 111, 103, 108, 101, 46, 99, 97, 115, 116, 46, 116, 112, 46, 99, 111, 110, 110, 101, 99, 116, 105, 111, 110, 40, 0, 50, 18, 123, 34, 116, 121, 112, 101, 34, 58, 34, 67, 79, 78, 78, 69, 67, 84, 34, 125 }; - Assert.Equal(bytes, expectedBytes); } @@ -32,7 +27,12 @@ public void Ping_Should_Be_Serialized_Well() { var pingMessage = MessageFactory.Ping; var bytes = pingMessage.ToProto(); - Assert.Equal(bytes, new byte[] { 0, 0, 0, 43, 8, 0, 18, 8, 115, 101, 110, 100, 101, 114, 45, 48, 26, 10, 114, 101, 99, 101, 105, 118, 101, 114, 45, 48, 40, 0, 50, 15, 123, 34, 116, 121, 112, 101, 34, 58, 34, 80, 73, 78, 71, 34, 125 }); + var expectedBytes = new byte[] + { + 0, 0, 0, 43, 8, 0, 18, 8, 115, 101, 110, 100, 101, 114, 45, 48, 26, 10, 114, 101, 99, 101, 105, 118, 101, + 114, 45, 48, 40, 0, 50, 15, 123, 34, 116, 121, 112, 101, 34, 58, 34, 80, 73, 78, 71, 34, 125 + }; + Assert.Equal(bytes, expectedBytes); } [Fact] @@ -40,23 +40,41 @@ public void Close_Should_Be_Serialized_Well() { var closeMessage = MessageFactory.Close; var bytes = closeMessage.ToProto(); - Assert.Equal(bytes, new byte[] { 0, 0, 0, 44, 8, 0, 18, 8, 115, 101, 110, 100, 101, 114, 45, 48, 26, 10, 114, 101, 99, 101, 105, 118, 101, 114, 45, 48, 40, 0, 50, 16, 123, 34, 116, 121, 112, 101, 34, 58, 34, 67, 76, 79, 83, 69, 34, 125 }); + var expectedBytes = new byte[] + { + 0, 0, 0, 44, 8, 0, 18, 8, 115, 101, 110, 100, 101, 114, 45, 48, 26, 10, 114, 101, 99, 101, 105, 118, 101, + 114, 45, 48, 40, 0, 50, 16, 123, 34, 116, 121, 112, 101, 34, 58, 34, 67, 76, 79, 83, 69, 34, 125 + }; + Assert.Equal(bytes, expectedBytes); } - [Fact(Skip = "RequestId of VolumeRequest changes every time")] + [Fact] public void Volume_Level_Should_Be_Serialized_Well() { - var volumeLevel = MessageFactory.Volume(0.7); + var volumeLevel = MessageFactory.Volume(0.7, 100); var bytes = volumeLevel.ToProto(); - Assert.Equal(bytes, new byte[] { 0, 0, 0, 94, 8, 0, 18, 8, 115, 101, 110, 100, 101, 114, 45, 48, 26, 10, 114, 101, 99, 101, 105, 118, 101, 114, 45, 48, 40, 0, 50, 66, 123, 34, 118, 111, 108, 117, 109, 101, 34, 58, 123, 34, 108, 101, 118, 101, 108, 34, 58, 48, 46, 55, 125, 44, 34, 114, 101, 113, 117, 101, 115, 116, 73, 100, 34, 58, 53, 53, 52, 55, 54, 51, 57, 50, 53, 44, 34, 116, 121, 112, 101, 34, 58, 34, 83, 69, 84, 95, 86, 79, 76, 85, 77, 69, 34, 125 }); + var expectedBytes = new byte[] + { + 0, 0, 0, 88, 8, 0, 18, 8, 115, 101, 110, 100, 101, 114, 45, 48, 26, 10, 114, 101, 99, 101, 105, 118, 101, + 114, 45, 48, 40, 0, 50, 60, 123, 34, 118, 111, 108, 117, 109, 101, 34, 58, 123, 34, 108, 101, 118, 101, + 108, 34, 58, 48, 46, 55, 125, 44, 34, 114, 101, 113, 117, 101, 115, 116, 73, 100, 34, 58, 49, 48, 48, 44, + 34, 116, 121, 112, 101, 34, 58, 34, 83, 69, 84, 95, 86, 79, 76, 85, 77, 69, 34, 125 + }; + Assert.Equal(bytes, expectedBytes); } - - [Fact(Skip = "RequestId of VolumeRequest changes every time")] + [Fact] public void Volume_Mute_Should_Be_Serialized_Well() { - var volumeMuted = MessageFactory.Volume(true); + var volumeMuted = MessageFactory.Volume(true, 100); var bytes = volumeMuted.ToProto(); - Assert.Equal(bytes, new byte[] { 0, 0, 0, 96, 8, 0, 18, 8, 115, 101, 110, 100, 101, 114, 45, 48, 26, 10, 114, 101, 99, 101, 105, 118, 101, 114, 45, 48, 40, 0, 50, 68, 123, 34, 118, 111, 108, 117, 109, 101, 34, 58, 123, 34, 109, 117, 116, 101, 100, 34, 58, 116, 114, 117, 101, 125, 44, 34, 114, 101, 113, 117, 101, 115, 116, 73, 100, 34, 58, 50, 48, 51, 53, 51, 56, 52, 49, 53, 56, 44, 34, 116, 121, 112, 101, 34, 58, 34, 83, 69, 84, 95, 86, 79, 76, 85, 77, 69, 34, 125 }); + var expectedBytes = new byte[] + { + 0, 0, 0, 89, 8, 0, 18, 8, 115, 101, 110, 100, 101, 114, 45, 48, 26, 10, 114, 101, 99, 101, 105, 118, 101, + 114, 45, 48, 40, 0, 50, 61, 123, 34, 118, 111, 108, 117, 109, 101, 34, 58, 123, 34, 109, 117, 116, 101, + 100, 34, 58, 116, 114, 117, 101, 125, 44, 34, 114, 101, 113, 117, 101, 115, 116, 73, 100, 34, 58, 49, 48, + 48, 44, 34, 116, 121, 112, 101, 34, 58, 34, 83, 69, 84, 95, 86, 79, 76, 85, 77, 69, 34, 125 + }; + Assert.Equal(bytes, expectedBytes); } private static string PrintBytes(byte[] byteArray) diff --git a/SharpCaster.Test/SharpCaster.Test.csproj b/SharpCaster.Test/SharpCaster.Test.csproj index c9c681a..d3d4c76 100644 --- a/SharpCaster.Test/SharpCaster.Test.csproj +++ b/SharpCaster.Test/SharpCaster.Test.csproj @@ -1,6 +1,6 @@  - + Debug @@ -33,8 +33,9 @@ 4 - - ..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll + + ..\packages\Google.Protobuf.3.3.0\lib\net45\Google.Protobuf.dll + True ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll @@ -48,16 +49,8 @@ ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll True - - ..\packages\protobuf-net-sharpcaster.2.0.0.668\lib\portable46-net451+win81+wpa81\protobuf-net.dll - True - - - ..\packages\Rssdp.2.0.0.5\lib\net40\Rssdp.Native.dll - True - - - ..\packages\Rssdp.2.0.0.5\lib\net40\Rssdp.Portable.dll + + ..\packages\Rssdp.3.5.4\lib\net45\Rssdp.dll True @@ -87,19 +80,19 @@ - ..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll + ..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll True - - ..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll + + ..\packages\xunit.assert.2.2.0\lib\netstandard1.1\xunit.assert.dll True - - ..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll + + ..\packages\xunit.extensibility.core.2.2.0\lib\netstandard1.1\xunit.core.dll True - - ..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll + + ..\packages\xunit.extensibility.execution.2.2.0\lib\net452\xunit.execution.desktop.dll True @@ -128,8 +121,8 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - +