Skip to content

Commit

Permalink
Move unit tests to .NET Core
Browse files Browse the repository at this point in the history
  • Loading branch information
qmfrederik committed Apr 18, 2017
1 parent 228b6f9 commit 737d36f
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 199 deletions.
2 changes: 1 addition & 1 deletion SharpAdbClient.Tests/ExceptionTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void TestMessageAndInnerConstructor(Func<string, Exception, T> con
Assert.AreEqual(inner, ex.InnerException);
}

#if !NETCOREAPP1_0
#if !NETCOREAPP1_1
public static void TestSerializationConstructor(Func<SerializationInfo, StreamingContext, T> constructor)
{
var info = new SerializationInfo(typeof(T), new FormatterConverter());
Expand Down
2 changes: 1 addition & 1 deletion SharpAdbClient.Tests/Exceptions/AdbExceptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void TestMessageAndInnerConstructor()
ExceptionTester<AdbException>.TestMessageAndInnerConstructor((message, inner) => new AdbException(message, inner));
}

#if !NETCOREAPP1_0
#if !NETCOREAPP1_1
[TestMethod]
public void TestSerializationConstructor()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void TestMessageAndInnerConstructor()
ExceptionTester<CommandAbortingException>.TestMessageAndInnerConstructor((message, inner) => new CommandAbortingException(message, inner));
}

#if !NETCOREAPP1_0
#if !NETCOREAPP1_1
[TestMethod]
public void TestSerializationConstructor()
{
Expand Down
2 changes: 1 addition & 1 deletion SharpAdbClient.Tests/Exceptions/DeviceNotFoundException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void TestMessageAndInnerConstructor()
ExceptionTester<DeviceNotFoundException>.TestMessageAndInnerConstructor((message, inner) => new DeviceNotFoundException(message, inner));
}

#if !NETCOREAPP1_0
#if !NETCOREAPP1_1
[TestMethod]
public void TestSerializationConstructor()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void TestMessageAndInnerConstructor()
ExceptionTester<PermissionDeniedException>.TestMessageAndInnerConstructor((message, inner) => new PermissionDeniedException(message, inner));
}

#if !NETCOREAPP1_0
#if !NETCOREAPP1_1
[TestMethod]
public void TestSerializationConstructor()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void TestMessageAndInnerConstructor()
ExceptionTester<ShellCommandUnresponsiveException>.TestMessageAndInnerConstructor((message, inner) => new ShellCommandUnresponsiveException(message, inner));
}

#if !NETCOREAPP1_0
#if !NETCOREAPP1_1
[TestMethod]
public void TestSerializationConstructor()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void TestMessageAndInnerConstructor()
ExceptionTester<UnknownOptionException>.TestMessageAndInnerConstructor((message, inner) => new UnknownOptionException(message, inner));
}

#if !NETCOREAPP1_0
#if !NETCOREAPP1_1
[TestMethod]
public void TestSerializationConstructor()
{
Expand Down
10 changes: 2 additions & 8 deletions SharpAdbClient.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle ( "MADB Tests" )]
[assembly: AssemblyDescription ( "" )]


[assembly: Guid ( "4300994a-cbc1-43b0-bf87-119cd4cf71a3" )]
[assembly: Guid("4300994a-cbc1-43b0-bf87-119cd4cf71a3")]
172 changes: 0 additions & 172 deletions SharpAdbClient.Tests/SharpAdbClient.Tests.csproj

This file was deleted.

14 changes: 2 additions & 12 deletions SharpAdbClient.Tests/TcpSocketTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,12 @@ public void BufferSizeTest()
socket.Dispose();
}

[TestMethod]
public void CreateSocketTest()
{
var winSocket = TcpSocket.CreateSocket(new IPEndPoint(IPAddress.Loopback, 0));
Assert.AreEqual(AddressFamily.InterNetwork, winSocket.AddressFamily);
Assert.AreEqual(SocketType.Stream, winSocket.SocketType);
Assert.AreEqual(ProtocolType.Tcp, winSocket.ProtocolType);

// Unix sockets cannot be created on Windows machines
}

[TestMethod]
[ExpectedException(typeof(NotSupportedException))]
public void CreateUnsupportedSocketTest()
{
TcpSocket.CreateSocket(new CustomEndPoint());
TcpSocket socket = new TcpSocket();
socket.Connect(new CustomEndPoint());
}
}
}
6 changes: 6 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ build_script:
- cmd: dotnet build -c Release --version-suffix beta%APPVEYOR_BUILD_NUMBER%
- cmd: dotnet pack -c Release --version-suffix beta%APPVEYOR_BUILD_NUMBER%

test_script:
- cmd: cd ..\SharpAdbClient.Tests\
- cmd: dotnet restore
- cmd: dotnet build
- cmd: dotnet vstest bin\Debug\netcoreapp1.1\SharpAdbClient.Tests.dll /testcasefilter:TestCategory!=IntegrationTest /logger:Appveyor

on_success:
- ps: Push-AppveyorArtifact "bin\Release\SharpAdbClient.2.1.0-beta$($env:APPVEYOR_BUILD_NUMBER).nupkg"
- ps: Push-AppveyorArtifact "bin\Release\SharpAdbClient.2.1.0-beta$($env:APPVEYOR_BUILD_NUMBER).symbols.nupkg"
Expand Down

0 comments on commit 737d36f

Please sign in to comment.