diff --git a/AdvancedSharpAdbClient.Tests/AdbClientTests.Async.cs b/AdvancedSharpAdbClient.Tests/AdbClientTests.Async.cs index abc85ec..667fada 100644 --- a/AdvancedSharpAdbClient.Tests/AdbClientTests.Async.cs +++ b/AdvancedSharpAdbClient.Tests/AdbClientTests.Async.cs @@ -19,7 +19,7 @@ public partial class AdbClientTests /// Tests the method. /// [Fact] - public async void GetAdbVersionAsyncTest() + public async Task GetAdbVersionAsyncTest() { string[] responseMessages = ["0020"]; string[] requests = ["host:version"]; @@ -38,7 +38,7 @@ public async void GetAdbVersionAsyncTest() /// Tests the method. /// [Fact] - public async void KillAdbAsyncTest() + public async Task KillAdbAsyncTest() { string[] requests = ["host:kill"]; @@ -53,7 +53,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void GetDevicesAsyncTest() + public async Task GetDevicesAsyncTest() { string[] responseMessages = ["169.254.109.177:5555 device product:VS Emulator 5\" KitKat (4.4) XXHDPI Phone model:5__KitKat__4_4__XXHDPI_Phone device:donatello\n"]; string[] requests = ["host:devices-l"]; @@ -80,7 +80,7 @@ public async void GetDevicesAsyncTest() /// Tests the method. /// [Fact] - public async void CreateForwardAsyncTest() => + public async Task CreateForwardAsyncTest() => await RunCreateForwardAsyncTest( device => TestClient.CreateForwardAsync(device, "tcp:1", "tcp:2", true), "tcp:1;tcp:2"); @@ -89,7 +89,7 @@ await RunCreateForwardAsyncTest( /// Tests the method. /// [Fact] - public async void CreateReverseAsyncTest() => + public async Task CreateReverseAsyncTest() => await RunCreateReverseAsyncTest( device => TestClient.CreateReverseForwardAsync(device, "tcp:1", "tcp:2", true), "tcp:1;tcp:2"); @@ -98,7 +98,7 @@ await RunCreateReverseAsyncTest( /// Tests the method. /// [Fact] - public async void CreateTcpForwardAsyncTest() => + public async Task CreateTcpForwardAsyncTest() => await RunCreateForwardAsyncTest( device => TestClient.CreateForwardAsync(device, 3, 4), "tcp:3;tcp:4"); @@ -107,7 +107,7 @@ await RunCreateForwardAsyncTest( /// Tests the method. /// [Fact] - public async void CreateSocketForwardAsyncTest() => + public async Task CreateSocketForwardAsyncTest() => await RunCreateForwardAsyncTest( device => TestClient.CreateForwardAsync(device, 5, "/socket/1"), "tcp:5;local:/socket/1"); @@ -116,7 +116,7 @@ await RunCreateForwardAsyncTest( /// Tests the method. /// [Fact] - public async void CreateDuplicateForwardAsyncTest() + public async Task CreateDuplicateForwardAsyncTest() { AdbResponse[] responses = [AdbResponse.FromError("cannot rebind existing socket")]; string[] requests = ["host-serial:169.254.109.177:5555:forward:norebind:tcp:1;tcp:2"]; @@ -133,7 +133,7 @@ public async void CreateDuplicateForwardAsyncTest() /// Tests the method. /// [Fact] - public async void RemoveForwardAsyncTest() + public async Task RemoveForwardAsyncTest() { string[] requests = ["host-serial:169.254.109.177:5555:killforward:tcp:1"]; @@ -148,7 +148,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void RemoveReverseForwardAsyncTest() + public async Task RemoveReverseForwardAsyncTest() { string[] requests = [ @@ -167,7 +167,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void RemoveAllForwardsAsyncTest() + public async Task RemoveAllForwardsAsyncTest() { string[] requests = ["host-serial:169.254.109.177:5555:killforward-all"]; @@ -182,7 +182,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void RemoveAllReversesAsyncTest() + public async Task RemoveAllReversesAsyncTest() { string[] requests = [ @@ -201,7 +201,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void ListForwardAsyncTest() + public async Task ListForwardAsyncTest() { string[] responseMessages = ["169.254.109.177:5555 tcp:1 tcp:2\n169.254.109.177:5555 tcp:3 tcp:4\n169.254.109.177:5555 tcp:5 local:/socket/1\n"]; string[] requests = ["host-serial:169.254.109.177:5555:list-forward"]; @@ -223,7 +223,7 @@ public async void ListForwardAsyncTest() /// Tests the method. /// [Fact] - public async void ListReverseForwardAsyncTest() + public async Task ListReverseForwardAsyncTest() { string[] responseMessages = ["(reverse) localabstract:scrcpy tcp:100\n(reverse) localabstract: scrcpy2 tcp:100\n(reverse) localabstract: scrcpy3 tcp:100\n"]; @@ -250,7 +250,7 @@ public async void ListReverseForwardAsyncTest() /// Tests the method. /// [Fact] - public async void ExecuteServerCommandAsyncTest() + public async Task ExecuteServerCommandAsyncTest() { string[] requests = ["host:version"]; @@ -275,7 +275,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void ExecuteRemoteCommandAsyncTest() + public async Task ExecuteRemoteCommandAsyncTest() { string[] requests = [ @@ -302,7 +302,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void ExecuteRemoteCommandAsyncUnresponsiveTest() + public async Task ExecuteRemoteCommandAsyncUnresponsiveTest() { string[] requests = [ @@ -325,7 +325,7 @@ public async void ExecuteRemoteCommandAsyncUnresponsiveTest() /// Tests the method. /// [Fact] - public async void GetFrameBufferAsyncTest() + public async Task GetFrameBufferAsyncTest() { string[] requests = [ @@ -389,7 +389,7 @@ await File.ReadAllBytesAsync("Assets/Framebuffer.bin") /// Tests the method. /// [Fact] - public async void RunLogServiceAsyncTest() + public async Task RunLogServiceAsyncTest() { string[] requests = [ @@ -418,7 +418,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void RunLogServiceEnumerableAsyncTest() + public async Task RunLogServiceEnumerableAsyncTest() { string[] requests = [ @@ -445,7 +445,7 @@ public async void RunLogServiceEnumerableAsyncTest() /// Tests the method. /// [Fact] - public async void RebootAsyncTest() + public async Task RebootAsyncTest() { string[] requests = [ @@ -464,7 +464,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void PairAsyncIPAddressTest() => + public async Task PairAsyncIPAddressTest() => await RunPairAsyncTest( () => TestClient.PairAsync(IPAddress.Loopback, "114514"), "127.0.0.1:5555", @@ -474,7 +474,7 @@ await RunPairAsyncTest( /// Tests the method. /// [Fact] - public async void PairAsyncDnsEndpointTest() => + public async Task PairAsyncDnsEndpointTest() => await RunPairAsyncTest( () => TestClient.PairAsync(new DnsEndPoint("localhost", 1234), "114514"), "localhost:1234", @@ -484,7 +484,7 @@ await RunPairAsyncTest( /// Tests the method. /// [Fact] - public async void PairAsyncIPEndpointTest() => + public async Task PairAsyncIPEndpointTest() => await RunPairAsyncTest( () => TestClient.PairAsync(new IPEndPoint(IPAddress.Loopback, 4321), "114514"), "127.0.0.1:4321", @@ -494,7 +494,7 @@ await RunPairAsyncTest( /// Tests the method. /// [Fact] - public async void PairAsyncHostEndpointTest() => + public async Task PairAsyncHostEndpointTest() => await RunPairAsyncTest( () => TestClient.PairAsync("localhost:9926", "114514"), "localhost:9926", @@ -504,35 +504,35 @@ await RunPairAsyncTest( /// Tests the method. /// [Fact] - public async void PairAsyncIPAddressNullTest() => + public async Task PairAsyncIPAddressNullTest() => _ = await Assert.ThrowsAsync(() => TestClient.PairAsync((IPAddress)null, "114514")); /// /// Tests the method. /// [Fact] - public async void PairAsyncDnsEndpointNullTest() => + public async Task PairAsyncDnsEndpointNullTest() => _ = await Assert.ThrowsAsync(() => TestClient.PairAsync((DnsEndPoint)null, "114514")); /// /// Tests the method. /// [Fact] - public async void PairAsyncIPEndpointNullTest() => + public async Task PairAsyncIPEndpointNullTest() => _ = await Assert.ThrowsAsync(() => TestClient.PairAsync((IPEndPoint)null, "114514")); /// /// Tests the method. /// [Fact] - public async void PairAsyncHostEndpointNullTest() => + public async Task PairAsyncHostEndpointNullTest() => _ = await Assert.ThrowsAsync(() => TestClient.PairAsync((string)null, "114514")); /// /// Tests the method. /// [Fact] - public async void ConnectAsyncIPAddressTest() => + public async Task ConnectAsyncIPAddressTest() => await RunConnectAsyncTest( () => TestClient.ConnectAsync(IPAddress.Loopback), "127.0.0.1:5555"); @@ -541,7 +541,7 @@ await RunConnectAsyncTest( /// Tests the method. /// [Fact] - public async void ConnectAsyncDnsEndpointTest() => + public async Task ConnectAsyncDnsEndpointTest() => await RunConnectAsyncTest( () => TestClient.ConnectAsync(new DnsEndPoint("localhost", 1234)), "localhost:1234"); @@ -550,7 +550,7 @@ await RunConnectAsyncTest( /// Tests the method. /// [Fact] - public async void ConnectAsyncIPEndpointTest() => + public async Task ConnectAsyncIPEndpointTest() => await RunConnectAsyncTest( () => TestClient.ConnectAsync(new IPEndPoint(IPAddress.Loopback, 4321)), "127.0.0.1:4321"); @@ -559,7 +559,7 @@ await RunConnectAsyncTest( /// Tests the method. /// [Fact] - public async void ConnectAsyncHostEndpointTest() => + public async Task ConnectAsyncHostEndpointTest() => await RunConnectAsyncTest( () => TestClient.ConnectAsync("localhost:9926"), "localhost:9926"); @@ -568,35 +568,35 @@ await RunConnectAsyncTest( /// Tests the method. /// [Fact] - public async void ConnectAsyncIPAddressNullTest() => + public async Task ConnectAsyncIPAddressNullTest() => _ = await Assert.ThrowsAsync(() => TestClient.ConnectAsync((IPAddress)null)); /// /// Tests the method. /// [Fact] - public async void ConnectAsyncDnsEndpointNullTest() => + public async Task ConnectAsyncDnsEndpointNullTest() => _ = await Assert.ThrowsAsync(() => TestClient.ConnectAsync((DnsEndPoint)null)); /// /// Tests the method. /// [Fact] - public async void ConnectAsyncIPEndpointNullTest() => + public async Task ConnectAsyncIPEndpointNullTest() => _ = await Assert.ThrowsAsync(() => TestClient.ConnectAsync((IPEndPoint)null)); /// /// Tests the method. /// [Fact] - public async void ConnectAsyncHostEndpointNullTest() => + public async Task ConnectAsyncHostEndpointNullTest() => _ = await Assert.ThrowsAsync(() => TestClient.ConnectAsync(null)); /// /// Tests the method. /// [Fact] - public async void DisconnectAsyncTest() + public async Task DisconnectAsyncTest() { string[] requests = ["host:disconnect:localhost:5555"]; string[] responseMessages = ["disconnected 127.0.0.1:5555"]; @@ -612,7 +612,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void RootAsyncTest() + public async Task RootAsyncTest() { string[] requests = [ @@ -639,7 +639,7 @@ public async void RootAsyncTest() /// Tests the method. /// [Fact] - public async void UnrootAsyncTest() + public async Task UnrootAsyncTest() { string[] requests = [ @@ -666,7 +666,7 @@ public async void UnrootAsyncTest() /// Tests the method. /// [Fact] - public async void InstallAsyncTest() + public async Task InstallAsyncTest() { // The app data is sent in chunks of 32 kb List applicationDataChunks = []; @@ -714,7 +714,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void InstallMultipleAsyncTest() + public async Task InstallMultipleAsyncTest() { // The app data is sent in chunks of 32 kb List applicationDataChunks = []; @@ -773,7 +773,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void InstallMultipleWithBaseAsyncTest() + public async Task InstallMultipleWithBaseAsyncTest() { // The app data is sent in chunks of 32 kb List applicationDataChunks = []; @@ -848,7 +848,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void InstallCreateAsyncTest() + public async Task InstallCreateAsyncTest() { string[] requests = [ @@ -873,7 +873,7 @@ public async void InstallCreateAsyncTest() /// Tests the method. /// [Fact] - public async void InstallWriteAsyncTest() + public async Task InstallWriteAsyncTest() { // The app data is sent in chunks of 32 kb List applicationDataChunks = []; @@ -924,7 +924,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void InstallCommitAsyncTest() + public async Task InstallCommitAsyncTest() { string[] requests = [ @@ -948,7 +948,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void InstallWinRTAsyncTest() + public async Task InstallWinRTAsyncTest() { // The app data is sent in chunks of 32 kb List applicationDataChunks = []; @@ -997,7 +997,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void InstallMultipleWinRTAsyncTest() + public async Task InstallMultipleWinRTAsyncTest() { // The app data is sent in chunks of 32 kb List applicationDataChunks = []; @@ -1057,7 +1057,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void InstallMultipleWinRTWithBaseAsyncTest() + public async Task InstallMultipleWinRTWithBaseAsyncTest() { // The app data is sent in chunks of 32 kb List applicationDataChunks = []; @@ -1134,7 +1134,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void InstallWriteWinRTAsyncTest() + public async Task InstallWriteWinRTAsyncTest() { // The app data is sent in chunks of 32 kb List applicationDataChunks = []; @@ -1187,7 +1187,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void UninstallAsyncTest() + public async Task UninstallAsyncTest() { string[] requests = [ @@ -1210,7 +1210,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void GetFeatureSetAsyncTest() + public async Task GetFeatureSetAsyncTest() { string[] requests = ["host-serial:169.254.109.177:5555:features"]; string[] responses = ["sendrecv_v2_brotli,remount_shell,sendrecv_v2,abb_exec,fixed_push_mkdir,fixed_push_symlink_timestamp,abb,shell_v2,cmd,ls_v2,apex,stat_v2\r\n"]; diff --git a/AdvancedSharpAdbClient.Tests/AdbCommandLineClientTests.Async.cs b/AdvancedSharpAdbClient.Tests/AdbCommandLineClientTests.Async.cs index 3f6720f..4b18526 100644 --- a/AdvancedSharpAdbClient.Tests/AdbCommandLineClientTests.Async.cs +++ b/AdvancedSharpAdbClient.Tests/AdbCommandLineClientTests.Async.cs @@ -1,5 +1,6 @@ using System; using System.Threading; +using System.Threading.Tasks; using Xunit; namespace AdvancedSharpAdbClient.Tests @@ -10,7 +11,7 @@ public partial class AdbCommandLineClientTests /// Tests the method. /// [Fact] - public async void GetVersionAsyncTest() + public async Task GetVersionAsyncTest() { Version adbVersion = new(1, 0, 41); string fileVersion = "34.0.4-android-tools"; @@ -29,7 +30,7 @@ public async void GetVersionAsyncTest() /// Tests the method. /// [Fact] - public async void GetVersionAsyncNullTest() + public async Task GetVersionAsyncNullTest() { DummyAdbCommandLineClient commandLine = new() { @@ -42,7 +43,7 @@ public async void GetVersionAsyncNullTest() /// Tests the method. /// [Fact] - public async void GetOutdatedVersionAsyncTest() + public async Task GetOutdatedVersionAsyncTest() { DummyAdbCommandLineClient commandLine = new() { @@ -55,7 +56,7 @@ public async void GetOutdatedVersionAsyncTest() /// Tests the method. /// [Fact] - public async void StartServerAsyncTest() + public async Task StartServerAsyncTest() { DummyAdbCommandLineClient commandLine = new(); Assert.False(commandLine.ServerStarted); diff --git a/AdvancedSharpAdbClient.Tests/AdbServerTests.Async.cs b/AdvancedSharpAdbClient.Tests/AdbServerTests.Async.cs index ac61005..e8a1c22 100644 --- a/AdvancedSharpAdbClient.Tests/AdbServerTests.Async.cs +++ b/AdvancedSharpAdbClient.Tests/AdbServerTests.Async.cs @@ -3,6 +3,7 @@ using System; using System.Net.Sockets; using System.Threading; +using System.Threading.Tasks; using Xunit; namespace AdvancedSharpAdbClient.Tests @@ -13,7 +14,7 @@ public partial class AdbServerTests /// Tests the method. /// [Fact] - public async void GetStatusAsyncNotRunningTest() + public async Task GetStatusAsyncNotRunningTest() { IAdbSocket adbSocketMock = Substitute.For(); adbSocketMock.SendAdbRequestAsync("host:version", Arg.Any()).Throws(new AggregateException(new SocketException(AdbServer.ConnectionRefused))); @@ -29,7 +30,7 @@ public async void GetStatusAsyncNotRunningTest() /// Tests the method. /// [Fact] - public async void GetStatusAsyncRunningTest() + public async Task GetStatusAsyncRunningTest() { socket.Responses.Enqueue(AdbResponse.OK); socket.ResponseMessages.Enqueue("0020"); @@ -49,7 +50,7 @@ public async void GetStatusAsyncRunningTest() /// Tests the method. /// [Fact] - public async void GetStatusAsyncOtherSocketExceptionTest() + public async Task GetStatusAsyncOtherSocketExceptionTest() { adbSocketFactory = endPoint => throw new SocketException(); @@ -62,7 +63,7 @@ public async void GetStatusAsyncOtherSocketExceptionTest() /// Tests the method. /// [Fact] - public async void GetStatusAsyncOtherExceptionTest() + public async Task GetStatusAsyncOtherExceptionTest() { adbSocketFactory = endPoint => throw new Exception(); @@ -75,7 +76,7 @@ public async void GetStatusAsyncOtherExceptionTest() /// Tests the method. /// [Fact] - public async void StartServerAsyncAlreadyRunningTest() + public async Task StartServerAsyncAlreadyRunningTest() { commandLineClient.Version = AdbCommandLineStatus.GetVersionFromOutput(["Android Debug Bridge version 1.0.20"]); socket.Responses.Enqueue(AdbResponse.OK); @@ -93,7 +94,7 @@ public async void StartServerAsyncAlreadyRunningTest() /// Tests the method. /// [Fact] - public async void StartServerAsyncOutdatedRunningNoExecutableTest() + public async Task StartServerAsyncOutdatedRunningNoExecutableTest() { socket.Responses.Enqueue(AdbResponse.OK); socket.ResponseMessages.Enqueue("0010"); @@ -106,7 +107,7 @@ public async void StartServerAsyncOutdatedRunningNoExecutableTest() /// Tests the method. /// [Fact] - public async void StartServerAsyncNotRunningNoExecutableTest() + public async Task StartServerAsyncNotRunningNoExecutableTest() { adbSocketFactory = endPoint => throw new SocketException(AdbServer.ConnectionRefused); @@ -120,7 +121,7 @@ public async void StartServerAsyncNotRunningNoExecutableTest() /// Tests the method. /// [Fact] - public async void StartServerAsyncOutdatedRunningTest() + public async Task StartServerAsyncOutdatedRunningTest() { socket.Responses.Enqueue(AdbResponse.OK); socket.ResponseMessages.Enqueue("0010"); @@ -141,7 +142,7 @@ public async void StartServerAsyncOutdatedRunningTest() /// Tests the method. /// [Fact] - public async void StartServerAsyncNotRunningTest() + public async Task StartServerAsyncNotRunningTest() { adbSocketFactory = endPoint => throw new SocketException(AdbServer.ConnectionRefused); @@ -160,7 +161,7 @@ public async void StartServerAsyncNotRunningTest() /// Tests the method. /// [Fact] - public async void StartServerAsyncIntermediateRestartRequestedRunningTest() + public async Task StartServerAsyncIntermediateRestartRequestedRunningTest() { socket.Responses.Enqueue(AdbResponse.OK); socket.ResponseMessages.Enqueue("001f"); @@ -181,7 +182,7 @@ public async void StartServerAsyncIntermediateRestartRequestedRunningTest() /// Tests the method. /// [Fact] - public async void StartServerAsyncIntermediateRestartNotRequestedRunningTest() + public async Task StartServerAsyncIntermediateRestartNotRequestedRunningTest() { socket.Responses.Enqueue(AdbResponse.OK); socket.ResponseMessages.Enqueue("001f"); @@ -201,7 +202,7 @@ public async void StartServerAsyncIntermediateRestartNotRequestedRunningTest() /// Tests the method. /// [Fact] - public async void RestartServerAsyncTest() + public async Task RestartServerAsyncTest() { socket.Responses.Enqueue(AdbResponse.OK); socket.ResponseMessages.Enqueue("001f"); @@ -222,7 +223,7 @@ public async void RestartServerAsyncTest() /// Tests the method. /// [Fact] - public async void StopServerAsyncTest() + public async Task StopServerAsyncTest() { await adbServer.StopServerAsync(); diff --git a/AdvancedSharpAdbClient.Tests/AdbSocketTests.Async.cs b/AdvancedSharpAdbClient.Tests/AdbSocketTests.Async.cs index 4980e6d..a2105e0 100644 --- a/AdvancedSharpAdbClient.Tests/AdbSocketTests.Async.cs +++ b/AdvancedSharpAdbClient.Tests/AdbSocketTests.Async.cs @@ -13,7 +13,7 @@ public partial class AdbSocketTests /// Tests the method. /// [Fact] - public async void SendSyncDATARequestAsyncTest() => + public async Task SendSyncDATARequestAsyncTest() => await RunTestAsync( socket => socket.SendSyncRequestAsync(SyncCommand.DATA, 2, default), [(byte)'D', (byte)'A', (byte)'T', (byte)'A', 2, 0, 0, 0]); @@ -22,7 +22,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void SendSyncSENDRequestAsyncTest() => + public async Task SendSyncSENDRequestAsyncTest() => await RunTestAsync( socket => socket.SendSyncRequestAsync(SyncCommand.SEND, "/test", UnixFileStatus.GroupMask | UnixFileStatus.StickyBit | UnixFileStatus.UserExecute | UnixFileStatus.OtherExecute, default), [(byte)'S', (byte)'E', (byte)'N', (byte)'D', 9, 0, 0, 0, (byte)'/', (byte)'t', (byte)'e', (byte)'s', (byte)'t', (byte)',', (byte)'6', (byte)'3', (byte)'3']); @@ -31,7 +31,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void SendSyncDENTRequestAsyncTest() => + public async Task SendSyncDENTRequestAsyncTest() => await RunTestAsync( socket => socket.SendSyncRequestAsync(SyncCommand.DENT, "/data", default), [(byte)'D', (byte)'E', (byte)'N', (byte)'T', 5, 0, 0, 0, (byte)'/', (byte)'d', (byte)'a', (byte)'t', (byte)'a']); @@ -40,7 +40,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void SendSyncNullRequestAsyncTest() => + public async Task SendSyncNullRequestAsyncTest() => _ = await Assert.ThrowsAsync(() => RunTestAsync(socket => socket.SendSyncRequestAsync(SyncCommand.DATA, null, default), [])); @@ -48,7 +48,7 @@ public async void SendSyncNullRequestAsyncTest() => /// Tests the method. /// [Fact] - public async void ReadSyncResponseAsync() + public async Task ReadSyncResponseAsync() { using DummyTcpSocket tcpSocket = new(); using AdbSocket socket = new(tcpSocket); @@ -67,7 +67,7 @@ public async void ReadSyncResponseAsync() /// Tests the method. /// [Fact] - public async void ReadStringAsyncTest() + public async Task ReadStringAsyncTest() { using DummyTcpSocket tcpSocket = new(); using AdbSocket socket = new(tcpSocket); @@ -88,7 +88,7 @@ public async void ReadStringAsyncTest() /// Tests the method. /// [Fact] - public async void ReadSyncStringAsyncTest() + public async Task ReadSyncStringAsyncTest() { using DummyTcpSocket tcpSocket = new(); using AdbSocket socket = new(tcpSocket); @@ -109,7 +109,7 @@ public async void ReadSyncStringAsyncTest() /// Tests the method. /// [Fact] - public async void ReadAdbOkayResponseAsyncTest() + public async Task ReadAdbOkayResponseAsyncTest() { using DummyTcpSocket tcpSocket = new(); using AdbSocket socket = new(tcpSocket); @@ -132,7 +132,7 @@ public async void ReadAdbOkayResponseAsyncTest() /// Tests the method. /// [Fact] - public async void ReadAdbFailResponseAsyncTest() + public async Task ReadAdbFailResponseAsyncTest() { using DummyTcpSocket tcpSocket = new(); using AdbSocket socket = new(tcpSocket); @@ -153,7 +153,7 @@ public async void ReadAdbFailResponseAsyncTest() /// Tests the method. /// [Fact] - public async void ReadAsyncTest() + public async Task ReadAsyncTest() { using DummyTcpSocket tcpSocket = new(); using AdbSocket socket = new(tcpSocket); @@ -185,7 +185,7 @@ public async void ReadAsyncTest() /// Tests the method. /// [Fact] - public async void ReadAsyncMemoryTest() + public async Task ReadAsyncMemoryTest() { using DummyTcpSocket tcpSocket = new(); using AdbSocket socket = new(tcpSocket); @@ -217,7 +217,7 @@ public async void ReadAsyncMemoryTest() /// Tests the method. /// [Fact] - public async void SendAdbRequestAsyncTest() => + public async Task SendAdbRequestAsyncTest() => await RunTestAsync( socket => socket.SendAdbRequestAsync("Test", default), "0004Test"u8.ToArray()); diff --git a/AdvancedSharpAdbClient.Tests/DeviceCommands/DeviceClientTexts.Async.cs b/AdvancedSharpAdbClient.Tests/DeviceCommands/DeviceClientTexts.Async.cs index c7b47f9..931e43b 100644 --- a/AdvancedSharpAdbClient.Tests/DeviceCommands/DeviceClientTexts.Async.cs +++ b/AdvancedSharpAdbClient.Tests/DeviceCommands/DeviceClientTexts.Async.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Threading; +using System.Threading.Tasks; using System.Xml; using Xunit; @@ -15,7 +16,7 @@ public partial class DeviceExtensionsTests /// Tests the method. /// [Fact] - public async void DumpScreenStringAsyncTest() + public async Task DumpScreenStringAsyncTest() { string dump = await File.ReadAllTextAsync(@"Assets/DumpScreen.txt"); string cleanDump = await File.ReadAllTextAsync(@"Assets/DumpScreen.Clean.xml"); @@ -35,7 +36,7 @@ public async void DumpScreenStringAsyncTest() /// Tests the method. /// [Fact] - public async void DumpScreenStringMIUIAsyncTest() + public async Task DumpScreenStringMIUIAsyncTest() { string miuidump = await File.ReadAllTextAsync(@"Assets/DumpScreen.MIUI.txt"); string cleanMIUIDump = await File.ReadAllTextAsync(@"Assets/DumpScreen.Clean.xml"); @@ -55,7 +56,7 @@ public async void DumpScreenStringMIUIAsyncTest() /// Tests the method. /// [Fact] - public async void DumpScreenStringEmptyAsyncTest() + public async Task DumpScreenStringEmptyAsyncTest() { DummyAdbClient client = new(); client.Commands["shell:uiautomator dump /dev/tty"] = string.Empty; @@ -72,7 +73,7 @@ public async void DumpScreenStringEmptyAsyncTest() /// Tests the method. /// [Fact] - public async void DumpScreenStringErrorAsyncTest() + public async Task DumpScreenStringErrorAsyncTest() { DummyAdbClient client = new(); client.Commands["shell:uiautomator dump /dev/tty"] = await File.ReadAllTextAsync(@"Assets/DumpScreen.Error.txt"); @@ -87,7 +88,7 @@ public async void DumpScreenStringErrorAsyncTest() /// Tests the method. /// [Fact] - public async void DumpScreenAsyncTest() + public async Task DumpScreenAsyncTest() { DummyAdbClient client = new(); client.Commands["shell:uiautomator dump /dev/tty"] = await File.ReadAllTextAsync(@"Assets/DumpScreen.txt"); @@ -109,7 +110,7 @@ public async void DumpScreenAsyncTest() /// Tests the method. /// [Fact] - public async void DumpScreenWinRTAsyncTest() + public async Task DumpScreenWinRTAsyncTest() { DummyAdbClient client = new(); client.Commands["shell:uiautomator dump /dev/tty"] = await File.ReadAllTextAsync(@"Assets/DumpScreen.txt"); @@ -132,7 +133,7 @@ public async void DumpScreenWinRTAsyncTest() /// Tests the method. /// [Fact] - public async void ClickAsyncTest() + public async Task ClickAsyncTest() { DummyAdbClient client = new(); client.Commands["shell:input tap 100 100"] = @"java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission @@ -192,7 +193,7 @@ at android.os.Binder.execTransactInternal(Binder.java:1165) /// Tests the method. /// [Fact] - public async void ClickCordsAsyncTest() + public async Task ClickCordsAsyncTest() { DummyAdbClient client = new(); client.Commands["shell:input tap 100 100"] = "Error: Injecting to another application requires INJECT_EVENTS permission\r\n"; @@ -207,7 +208,7 @@ public async void ClickCordsAsyncTest() /// Tests the method. /// [Fact] - public async void SwipeAsyncTest() + public async Task SwipeAsyncTest() { DummyAdbClient client = new(); client.Commands["shell:input swipe 100 200 300 400 500"] = string.Empty; @@ -222,7 +223,7 @@ public async void SwipeAsyncTest() /// Tests the method. /// [Fact] - public async void SwipePointAsyncTest() + public async Task SwipePointAsyncTest() { DummyAdbClient client = new(); client.Commands["shell:input swipe 100 200 300 400 500"] = string.Empty; @@ -237,7 +238,7 @@ public async void SwipePointAsyncTest() /// Tests the method. /// [Fact] - public async void SwipeElementAsyncTest() + public async Task SwipeElementAsyncTest() { DummyAdbClient client = new(); client.Commands["shell:input swipe 100 200 300 400 500"] = string.Empty; @@ -259,7 +260,7 @@ public async void SwipeElementAsyncTest() [InlineData("\r\n", false)] [InlineData(" ", false)] [InlineData("", false)] - public async void IsAppRunningAsyncTest(string response, bool expected) + public async Task IsAppRunningAsyncTest(string response, bool expected) { DummyAdbClient client = new(); client.Commands["shell:pidof com.google.android.gms"] = response; @@ -279,7 +280,7 @@ public async void IsAppRunningAsyncTest(string response, bool expected) [InlineData("app.lawnchair", true)] [InlineData("com.android.settings", true)] [InlineData("com.google.android.gms", false)] - public async void IsAppInForegroundAsyncTest(string packageName, bool expected) + public async Task IsAppInForegroundAsyncTest(string packageName, bool expected) { DummyAdbClient client = new(); client.Commands["shell:dumpsys activity activities | grep mResumedActivity"] = @" mResumedActivity: ActivityRecord{1f5309a u0 com.android.settings/.homepage.SettingsHomepageActivity t61029} @@ -299,7 +300,7 @@ public async void IsAppInForegroundAsyncTest(string packageName, bool expected) [Theory] [InlineData("com.google.android.gms", "21216 27761\r\n", AppStatus.Background)] [InlineData("com.android.gallery3d", "\r\n", AppStatus.Stopped)] - public async void GetAppStatusAsyncTest(string packageName, string response, AppStatus expected) + public async Task GetAppStatusAsyncTest(string packageName, string response, AppStatus expected) { DummyAdbClient client = new(); client.Commands["shell:dumpsys activity activities | grep mResumedActivity"] = @" mResumedActivity: ActivityRecord{1f5309a u0 com.android.settings/.homepage.SettingsHomepageActivity t61029} @@ -321,7 +322,7 @@ public async void GetAppStatusAsyncTest(string packageName, string response, App [Theory] [InlineData("app.lawnchair", AppStatus.Foreground)] [InlineData("com.android.settings", AppStatus.Foreground)] - public async void GetAppStatusForegroundAsyncTest(string packageName, AppStatus expected) + public async Task GetAppStatusForegroundAsyncTest(string packageName, AppStatus expected) { DummyAdbClient client = new(); client.Commands["shell:dumpsys activity activities | grep mResumedActivity"] = @" mResumedActivity: ActivityRecord{1f5309a u0 com.android.settings/.homepage.SettingsHomepageActivity t61029} @@ -339,7 +340,7 @@ public async void GetAppStatusForegroundAsyncTest(string packageName, AppStatus /// Tests the method. /// [Fact] - public async void FindElementAsyncTest() + public async Task FindElementAsyncTest() { DummyAdbClient client = new(); client.Commands["shell:uiautomator dump /dev/tty"] = File.ReadAllText(@"Assets/DumpScreen.txt"); @@ -364,7 +365,7 @@ public async void FindElementAsyncTest() /// Tests the method. /// [Fact] - public async void FindElementsAsyncTest() + public async Task FindElementsAsyncTest() { DummyAdbClient client = new(); client.Commands["shell:uiautomator dump /dev/tty"] = File.ReadAllText(@"Assets/DumpScreen.txt"); @@ -386,7 +387,7 @@ public async void FindElementsAsyncTest() /// Tests the method. /// [Fact] - public async void FindAsyncElementsTest() + public async Task FindAsyncElementsTest() { DummyAdbClient client = new(); client.Commands["shell:uiautomator dump /dev/tty"] = File.ReadAllText(@"Assets/DumpScreen.txt"); @@ -408,7 +409,7 @@ public async void FindAsyncElementsTest() /// Tests the method. /// [Fact] - public async void SendKeyEventAsyncTest() + public async Task SendKeyEventAsyncTest() { DummyAdbClient client = new(); client.Commands["shell:input keyevent KEYCODE_MOVE_END"] = string.Empty; @@ -423,7 +424,7 @@ public async void SendKeyEventAsyncTest() /// Tests the method. /// [Fact] - public async void SendTextAsyncTest() + public async Task SendTextAsyncTest() { DummyAdbClient client = new(); client.Commands["shell:input text Hello, World"] = string.Empty; @@ -438,7 +439,7 @@ public async void SendTextAsyncTest() /// Tests the method. /// [Fact] - public async void StartAppAsyncTest() + public async Task StartAppAsyncTest() { DummyAdbClient client = new(); @@ -452,7 +453,7 @@ public async void StartAppAsyncTest() /// Tests the method. /// [Fact] - public async void StopAppAsyncTest() + public async Task StopAppAsyncTest() { DummyAdbClient client = new(); diff --git a/AdvancedSharpAdbClient.Tests/DeviceCommands/DeviceExtensionsTests.Async.cs b/AdvancedSharpAdbClient.Tests/DeviceCommands/DeviceExtensionsTests.Async.cs index 8bf4818..49dd392 100644 --- a/AdvancedSharpAdbClient.Tests/DeviceCommands/DeviceExtensionsTests.Async.cs +++ b/AdvancedSharpAdbClient.Tests/DeviceCommands/DeviceExtensionsTests.Async.cs @@ -10,7 +10,7 @@ namespace AdvancedSharpAdbClient.DeviceCommands.Tests public partial class DeviceExtensionsTests { [Fact] - public async void ExecuteServerCommandAsyncTest() + public async Task ExecuteServerCommandAsyncTest() { const string command = nameof(command); IAdbSocket socket = Substitute.For(); @@ -47,7 +47,7 @@ public async void ExecuteServerCommandAsyncTest() /// Tests the method. /// [Fact] - public async void ClearInputAsyncTest() + public async Task ClearInputAsyncTest() { DummyAdbClient client = new(); client.Commands["shell:input keyevent KEYCODE_MOVE_END"] = string.Empty; @@ -64,7 +64,7 @@ public async void ClearInputAsyncTest() /// Tests the method. /// [Fact] - public async void ClickBackButtonAsyncTest() + public async Task ClickBackButtonAsyncTest() { DummyAdbClient client = new(); client.Commands["shell:input keyevent KEYCODE_BACK"] = string.Empty; @@ -79,7 +79,7 @@ public async void ClickBackButtonAsyncTest() /// Tests the method. /// [Fact] - public async void ClickHomeButtonAsyncTest() + public async Task ClickHomeButtonAsyncTest() { DummyAdbClient client = new(); client.Commands["shell:input keyevent KEYCODE_HOME"] = string.Empty; @@ -94,7 +94,7 @@ public async void ClickHomeButtonAsyncTest() /// Tests the method. /// [Fact] - public async void StatAsyncTest() + public async Task StatAsyncTest() { const string remotePath = "/test"; FileStatistics stats = new(); @@ -123,7 +123,7 @@ public async void StatAsyncTest() /// Tests the method. /// [Fact] - public async void GetDirectoryListingAsyncTest() + public async Task GetDirectoryListingAsyncTest() { const string remotePath = "/test"; List stats = [new()]; @@ -152,7 +152,7 @@ public async void GetDirectoryListingAsyncTest() /// Tests the method. /// [Fact] - public async void GetDirectoryAsyncListingTest() + public async Task GetDirectoryAsyncListingTest() { const string remotePath = "/test"; List stats = [new()]; @@ -181,7 +181,7 @@ public async void GetDirectoryAsyncListingTest() /// Tests the method. /// [Fact] - public async void GetEnvironmentVariablesAsyncTest() + public async Task GetEnvironmentVariablesAsyncTest() { DummyAdbClient adbClient = new(); @@ -198,7 +198,7 @@ public async void GetEnvironmentVariablesAsyncTest() /// Tests the method. /// [Fact] - public async void UninstallPackageAsyncTests() + public async Task UninstallPackageAsyncTests() { DummyAdbClient adbClient = new(); @@ -440,7 +440,7 @@ Package [jp.co.cyberagent.stf] (13d33a7): Compiler stats: [jp.co.cyberagent.stf] base.apk - 1084", 4, "2.1.0", "jp.co.cyberagent.stf")] - public async void GetPackageVersionAsyncTest(string command, int versionCode, string versionName, string packageName) + public async Task GetPackageVersionAsyncTest(string command, int versionCode, string versionName, string packageName) { DummyAdbClient adbClient = new(); @@ -459,7 +459,7 @@ public async void GetPackageVersionAsyncTest(string command, int versionCode, st /// Tests the method. /// [Fact] - public async void ListProcessesAsyncTest() + public async Task ListProcessesAsyncTest() { DummyAdbClient adbClient = new(); diff --git a/AdvancedSharpAdbClient.Tests/DeviceCommands/PackageManagerTests.Async.cs b/AdvancedSharpAdbClient.Tests/DeviceCommands/PackageManagerTests.Async.cs index e426f76..b93e39a 100644 --- a/AdvancedSharpAdbClient.Tests/DeviceCommands/PackageManagerTests.Async.cs +++ b/AdvancedSharpAdbClient.Tests/DeviceCommands/PackageManagerTests.Async.cs @@ -1,4 +1,5 @@ using System.IO; +using System.Threading.Tasks; using Xunit; namespace AdvancedSharpAdbClient.DeviceCommands.Tests @@ -6,7 +7,7 @@ namespace AdvancedSharpAdbClient.DeviceCommands.Tests public partial class PackageManagerTests { [Fact] - public async void InstallRemotePackageAsyncTest() + public async Task InstallRemotePackageAsyncTest() { DummyAdbClient adbClient = new(); @@ -30,7 +31,7 @@ public async void InstallRemotePackageAsyncTest() } [Fact] - public async void InstallPackageAsyncTest() + public async Task InstallPackageAsyncTest() { DummySyncService syncService = new(); @@ -59,7 +60,7 @@ await manager.InstallPackageAsync("Assets/TestApp/base.apk", } [Fact] - public async void InstallMultipleRemotePackageAsyncTest() + public async Task InstallMultipleRemotePackageAsyncTest() { DummyAdbClient adbClient = new(); @@ -133,7 +134,7 @@ await manager.InstallMultipleRemotePackageAsync(["/data/split_config.arm64_v8a.a } [Fact] - public async void InstallMultiplePackageAsyncTest() + public async Task InstallMultiplePackageAsyncTest() { DummySyncService syncService = new(); @@ -204,7 +205,7 @@ await manager.InstallMultiplePackageAsync(["Assets/TestApp/split_config.arm64_v8 } [Fact] - public async void UninstallPackageAsyncTest() + public async Task UninstallPackageAsyncTest() { DummyAdbClient client = new(); client.Commands["shell:pm list packages -f"] = "package:/system/app/Gallery2/Gallery2.apk=com.android.gallery3d"; @@ -217,7 +218,7 @@ public async void UninstallPackageAsyncTest() } [Fact] - public async void GetPackageVersionInfoAsyncTest() + public async Task GetPackageVersionInfoAsyncTest() { DummyAdbClient client = new(); client.Commands["shell:dumpsys package com.google.android.gms"] = File.ReadAllText("Assets/DumpSys.GApps.txt"); diff --git a/AdvancedSharpAdbClient.Tests/DeviceMonitorTests.Async.cs b/AdvancedSharpAdbClient.Tests/DeviceMonitorTests.Async.cs index bd455b1..cbd021a 100644 --- a/AdvancedSharpAdbClient.Tests/DeviceMonitorTests.Async.cs +++ b/AdvancedSharpAdbClient.Tests/DeviceMonitorTests.Async.cs @@ -8,7 +8,7 @@ namespace AdvancedSharpAdbClient.Tests public partial class DeviceMonitorTests { [Fact] - public async void DeviceDisconnectedAsyncTest() + public async Task DeviceDisconnectedAsyncTest() { Socket.WaitForNewData = true; @@ -56,7 +56,7 @@ await RunTestAsync( } [Fact] - public async void DeviceConnectedAsyncTest() + public async Task DeviceConnectedAsyncTest() { Socket.WaitForNewData = true; @@ -107,7 +107,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void StartInitialDeviceListAsyncTest() + public async Task StartInitialDeviceListAsyncTest() { Socket.WaitForNewData = true; @@ -133,7 +133,7 @@ await RunTestAsync( } [Fact] - public async void TriggeredWhenStatusChangedAsyncTest() + public async Task TriggeredWhenStatusChangedAsyncTest() { Socket.WaitForNewData = true; @@ -183,7 +183,7 @@ await RunTestAsync( } [Fact] - public async void NoTriggerIfStatusIsSameAsyncTest() + public async Task NoTriggerIfStatusIsSameAsyncTest() { Socket.WaitForNewData = true; @@ -236,7 +236,7 @@ await RunTestAsync( /// loop. The should detect this condition and restart the adb server. /// [Fact] - public async void AdbKilledAsyncTest() + public async Task AdbKilledAsyncTest() { DummyAdbServer dummyAdbServer = new(); AdbServer.Instance = dummyAdbServer; diff --git a/AdvancedSharpAdbClient.Tests/Extensions/AdbClientExtensionsTests.Async.cs b/AdvancedSharpAdbClient.Tests/Extensions/AdbClientExtensionsTests.Async.cs index 27258a6..be84f69 100644 --- a/AdvancedSharpAdbClient.Tests/Extensions/AdbClientExtensionsTests.Async.cs +++ b/AdvancedSharpAdbClient.Tests/Extensions/AdbClientExtensionsTests.Async.cs @@ -12,7 +12,7 @@ namespace AdvancedSharpAdbClient.Tests public partial class AdbClientExtensionsTests { [Fact] - public async void ExecuteServerCommandAsyncTest() + public async Task ExecuteServerCommandAsyncTest() { const string target = nameof(target); const string command = nameof(command); @@ -75,7 +75,7 @@ public async void ExecuteServerCommandAsyncTest() } [Fact] - public async void ExecuteRemoteCommandAsyncTest() + public async Task ExecuteRemoteCommandAsyncTest() { const string command = nameof(command); DeviceData device = new() { Serial = "169.254.109.177:5555" }; @@ -112,7 +112,7 @@ public async void ExecuteRemoteCommandAsyncTest() } [Fact] - public async void RunLogServiceAsyncTest() + public async Task RunLogServiceAsyncTest() { DeviceData device = new() { Serial = "169.254.109.177:5555" }; IProgress progress = Substitute.For>(); diff --git a/AdvancedSharpAdbClient.Tests/Extensions/EnumerableExtensionsTests.cs b/AdvancedSharpAdbClient.Tests/Extensions/EnumerableExtensionsTests.cs index ed2953d..94f0b90 100644 --- a/AdvancedSharpAdbClient.Tests/Extensions/EnumerableExtensionsTests.cs +++ b/AdvancedSharpAdbClient.Tests/Extensions/EnumerableExtensionsTests.cs @@ -39,7 +39,7 @@ public void AddRangeTest() /// Tests the method. /// [Fact] - public async void TaskToArrayTest() + public async Task TaskToArrayTest() { int[] array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; Task> arrayTask = TaskExExtensions.Delay(10).ContinueWith(_ => array.Select(x => x)); diff --git a/AdvancedSharpAdbClient.Tests/Logs/LogTests.cs b/AdvancedSharpAdbClient.Tests/Logs/LogTests.cs index 5198d70..a5c6774 100644 --- a/AdvancedSharpAdbClient.Tests/Logs/LogTests.cs +++ b/AdvancedSharpAdbClient.Tests/Logs/LogTests.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Threading.Tasks; using Xunit; namespace AdvancedSharpAdbClient.Logs.Tests @@ -37,7 +38,7 @@ public void ReadLogTest() } [Fact] - public async void ReadLogAsyncTest() + public async Task ReadLogAsyncTest() { await using FileStream stream = File.OpenRead(@"Assets/Logcat.bin"); await using ShellStream shellStream = new(stream, false); @@ -100,7 +101,7 @@ public void ReadEventLogTest() } [Fact] - public async void ReadEventLogAsyncTest() + public async Task ReadEventLogAsyncTest() { // The data in this stream was read using a ShellStream, so the CRLF fixing // has already taken place. diff --git a/AdvancedSharpAdbClient.Tests/Models/FramebufferTests.cs b/AdvancedSharpAdbClient.Tests/Models/FramebufferTests.cs index a9cc0a4..f6e07c9 100644 --- a/AdvancedSharpAdbClient.Tests/Models/FramebufferTests.cs +++ b/AdvancedSharpAdbClient.Tests/Models/FramebufferTests.cs @@ -3,6 +3,7 @@ using System.Drawing.Imaging; using System.IO; using System.Net; +using System.Threading.Tasks; using Xunit; namespace AdvancedSharpAdbClient.Models.Tests @@ -85,7 +86,7 @@ public void RefreshTest() } [Fact] - public async void RefreshAsyncTest() + public async Task RefreshAsyncTest() { DeviceData device = new() { diff --git a/AdvancedSharpAdbClient.Tests/Models/ShellStreamTests.cs b/AdvancedSharpAdbClient.Tests/Models/ShellStreamTests.cs index d386f89..8761eb1 100644 --- a/AdvancedSharpAdbClient.Tests/Models/ShellStreamTests.cs +++ b/AdvancedSharpAdbClient.Tests/Models/ShellStreamTests.cs @@ -1,6 +1,7 @@ using System; using System.IO; using System.Text; +using System.Threading.Tasks; using Xunit; namespace AdvancedSharpAdbClient.Models.Tests @@ -103,7 +104,7 @@ public void PendingByteTest() } [Fact] - public async void CRLFAtStartAsyncTest() + public async Task CRLFAtStartAsyncTest() { await using MemoryStream stream = GetStream("\r\nHello, World!"); await using ShellStream shellStream = new(stream, false); @@ -122,7 +123,7 @@ public async void CRLFAtStartAsyncTest() } [Fact] - public async void MultipleCRLFInStringAsyncTest() + public async Task MultipleCRLFInStringAsyncTest() { await using MemoryStream stream = GetStream("\r\n1\r\n2\r\n3\r\n4\r\n5"); await using ShellStream shellStream = new(stream, false); @@ -144,7 +145,7 @@ public async void MultipleCRLFInStringAsyncTest() } [Fact] - public async void PendingByteAsyncTest() + public async Task PendingByteAsyncTest() { await using MemoryStream stream = GetStream("\r\nH\ra"); await using ShellStream shellStream = new(stream, false); diff --git a/AdvancedSharpAdbClient.Tests/SyncServiceTests.Async.cs b/AdvancedSharpAdbClient.Tests/SyncServiceTests.Async.cs index 40338b9..7693ef0 100644 --- a/AdvancedSharpAdbClient.Tests/SyncServiceTests.Async.cs +++ b/AdvancedSharpAdbClient.Tests/SyncServiceTests.Async.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using System.Threading; +using System.Threading.Tasks; using Xunit; namespace AdvancedSharpAdbClient.Tests @@ -12,7 +13,7 @@ public partial class SyncServiceTests /// Tests the method. /// [Fact] - public async void StatAsyncTest() + public async Task StatAsyncTest() { FileStatistics value = await RunTestAsync( OkResponses(2), @@ -41,7 +42,7 @@ public async void StatAsyncTest() /// Tests the method. /// [Fact] - public async void GetListingAsyncTest() + public async Task GetListingAsyncTest() { List value = await RunTestAsync( OkResponses(2), @@ -98,7 +99,7 @@ public async void GetListingAsyncTest() /// Tests the method. /// [Fact] - public async void GetAsyncListingTest() + public async Task GetAsyncListingTest() { List value = await RunTestAsync( OkResponses(2), @@ -155,7 +156,7 @@ public async void GetAsyncListingTest() /// Tests the method. /// [Fact] - public async void PullAsyncTest() + public async Task PullAsyncTest() { await using MemoryStream stream = new(); byte[] content = await File.ReadAllBytesAsync("Assets/Fstab.bin"); @@ -192,7 +193,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void PushAsyncTest() + public async Task PushAsyncTest() { FileStream stream = File.OpenRead("Assets/Fstab.bin"); byte[] content = await File.ReadAllBytesAsync("Assets/Fstab.bin"); @@ -227,7 +228,7 @@ await RunTestAsync( /// Tests the field. /// [Fact] - public async void IsProcessingAsyncTest() + public async Task IsProcessingAsyncTest() { await RunTestAsync( OkResponses(2), @@ -268,7 +269,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void PullWinRTAsyncTest() + public async Task PullWinRTAsyncTest() { using InMemoryRandomAccessStream stream = new(); byte[] content = await File.ReadAllBytesAsync("Assets/Fstab.bin"); @@ -306,7 +307,7 @@ await RunTestAsync( /// Tests the method. /// [Fact] - public async void PushWinRTAsyncTest() + public async Task PushWinRTAsyncTest() { StorageFile storageFile = await StorageFile.GetFileFromPathAsync(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"Assets\Fstab.bin")); using IRandomAccessStreamWithContentType stream = await storageFile.OpenReadAsync(); diff --git a/AdvancedSharpAdbClient.Tests/TcpSocketTests.Async.cs b/AdvancedSharpAdbClient.Tests/TcpSocketTests.Async.cs index 81db9c5..f436ae0 100644 --- a/AdvancedSharpAdbClient.Tests/TcpSocketTests.Async.cs +++ b/AdvancedSharpAdbClient.Tests/TcpSocketTests.Async.cs @@ -3,6 +3,7 @@ using System.Net.Sockets; using System.Text; using System.Threading; +using System.Threading.Tasks; using Xunit; namespace AdvancedSharpAdbClient.Tests @@ -10,7 +11,7 @@ namespace AdvancedSharpAdbClient.Tests public partial class TcpSocketTests { [Fact] - public async void LifecycleAsyncTest() + public async Task LifecycleAsyncTest() { using TcpSocket socket = new(); Assert.False(socket.Connected); @@ -28,7 +29,7 @@ public async void LifecycleAsyncTest() } [Fact] - public async void LifecycleAsyncMemoryTest() + public async Task LifecycleAsyncMemoryTest() { using TcpSocket socket = new(); Assert.False(socket.Connected); @@ -49,7 +50,7 @@ public async void LifecycleAsyncMemoryTest() /// Tests the method. /// [Fact] - public async void ReconnectAsyncTest() + public async Task ReconnectAsyncTest() { using TcpSocket socket = new(); Assert.False(socket.Connected); @@ -68,7 +69,7 @@ public async void ReconnectAsyncTest() /// Tests the method. /// [Fact] - public async void CreateUnsupportedSocketAsyncTest() + public async Task CreateUnsupportedSocketAsyncTest() { using TcpSocket socket = new(); _ = await Assert.ThrowsAsync(() => socket.ConnectAsync(new CustomEndPoint()));