Skip to content

Commit 7e1a26e

Browse files
committed
Fix ToString tests
Remove [SupportedOSPlatform("Windows10.0.10240.0")]
1 parent 99ebe4a commit 7e1a26e

26 files changed

+29
-197
lines changed

AdvancedSharpAdbClient.Tests/AdbClientTests.Async.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ await RunTestAsync(
935935
() => TestClient.InstallCommitAsync(Device, "936013062"));
936936
}
937937

938-
#if WINDOWS10_0_18362_0_OR_GREATER
938+
#if WINDOWS10_0_17763_0_OR_GREATER
939939
/// <summary>
940940
/// Tests the <see cref="AdbClient.InstallAsync(DeviceData, IRandomAccessStream, Action{InstallProgressEventArgs}?, CancellationToken, string[])"/> method.
941941
/// </summary>

AdvancedSharpAdbClient.Tests/AdbClientTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,7 @@ public void GetFeatureSetTest()
11591159
public void CloneTest()
11601160
{
11611161
Assert.True(TestClient is ICloneable<IAdbClient>);
1162-
#if WINDOWS10_0_18362_0_OR_GREATER
1162+
#if WINDOWS10_0_17763_0_OR_GREATER
11631163
Assert.True(TestClient is ICloneable<IAdbClient.IWinRT>);
11641164
#endif
11651165
AdbClient client = TestClient.Clone();

AdvancedSharpAdbClient.Tests/DeviceCommands/DeviceClientTexts.Async.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public async Task DumpScreenAsyncTest()
105105
Assert.Equal(doc, xml);
106106
}
107107

108-
#if WINDOWS10_0_18362_0_OR_GREATER
108+
#if WINDOWS10_0_17763_0_OR_GREATER
109109
/// <summary>
110110
/// Tests the <see cref="DeviceClient.DumpScreenWinRTAsync(CancellationToken)"/> method.
111111
/// </summary>

AdvancedSharpAdbClient.Tests/DeviceCommands/DeviceClientTexts.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public void DumpScreenTest()
191191
Assert.Equal(doc, xml);
192192
}
193193

194-
#if WINDOWS10_0_18362_0_OR_GREATER
194+
#if WINDOWS10_0_17763_0_OR_GREATER
195195
/// <summary>
196196
/// Tests the <see cref="DeviceClient.DumpScreenWinRT()"/> method.
197197
/// </summary>

AdvancedSharpAdbClient.Tests/DeviceCommands/Models/VersionInfoTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public void TryAsVersionTest(int versionCode, string versionName, bool expected)
3232
}
3333
}
3434

35-
#if WINDOWS10_0_18362_0_OR_GREATER
35+
#if WINDOWS10_0_17763_0_OR_GREATER
3636
/// <summary>
3737
/// Tests the <see cref="VersionInfo.TryAsPackageVersion(out PackageVersion)"/> method.
3838
/// </summary>

AdvancedSharpAdbClient.Tests/Logs/LogTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void ReadLogTest()
3434
Assert.Equal(Priority.Info, androidLog.Priority);
3535
Assert.Equal("ActivityManager", androidLog.Tag);
3636
Assert.Equal("Start proc com.google.android.gm for broadcast com.google.android.gm/.widget.GmailWidgetProvider: pid=7026 uid=10066 gids={50066, 9997, 3003, 1028, 1015} abi=x86", androidLog.Message);
37-
Assert.Equal($"15-11-15 07:38:20.000 707 707 I ActivityManager: Start proc com.google.android.gm for broadcast com.google.android.gm/.widget.GmailWidgetProvider: pid=7026 uid=10066 gids={{50066, 9997, 3003, 1028, 1015}} abi=x86", androidLog.ToString());
37+
Assert.Equal($"{log.TimeStamp.LocalDateTime:yy-MM-dd HH:mm:ss.fff} 707 707 I ActivityManager: Start proc com.google.android.gm for broadcast com.google.android.gm/.widget.GmailWidgetProvider: pid=7026 uid=10066 gids={{50066, 9997, 3003, 1028, 1015}} abi=x86", androidLog.ToString());
3838

3939
Assert.NotNull(reader.ReadEntry());
4040
Assert.NotNull(reader.ReadEntry());
@@ -64,7 +64,7 @@ public async Task ReadLogAsyncTest()
6464
Assert.Equal(Priority.Info, androidLog.Priority);
6565
Assert.Equal("ActivityManager", androidLog.Tag);
6666
Assert.Equal("Start proc com.google.android.gm for broadcast com.google.android.gm/.widget.GmailWidgetProvider: pid=7026 uid=10066 gids={50066, 9997, 3003, 1028, 1015} abi=x86", androidLog.Message);
67-
Assert.Equal($"15-11-15 07:38:20.000 707 707 I ActivityManager: Start proc com.google.android.gm for broadcast com.google.android.gm/.widget.GmailWidgetProvider: pid=7026 uid=10066 gids={{50066, 9997, 3003, 1028, 1015}} abi=x86", androidLog.ToString());
67+
Assert.Equal($"{log.TimeStamp.LocalDateTime:yy-MM-dd HH:mm:ss.fff} 707 707 I ActivityManager: Start proc com.google.android.gm for broadcast com.google.android.gm/.widget.GmailWidgetProvider: pid=7026 uid=10066 gids={{50066, 9997, 3003, 1028, 1015}} abi=x86", androidLog.ToString());
6868

6969
Assert.NotNull(await reader.ReadEntryAsync());
7070
Assert.NotNull(await reader.ReadEntryAsync());
@@ -93,7 +93,7 @@ public void ReadEventLogTest()
9393
Assert.Single(eventLog.Values);
9494
Assert.NotNull(eventLog.Values[0]);
9595
Assert.IsType<List<object>>(eventLog.Values[0]);
96-
Assert.Equal($"15-11-16 09:48:40.000 707 707 0 : System.Collections.Generic.List`1[System.Object]", eventLog.ToString());
96+
Assert.Equal($"{entry.TimeStamp.LocalDateTime:yy-MM-dd HH:mm:ss.fff} 707 707 0 : System.Collections.Generic.List`1[System.Object]", eventLog.ToString());
9797

9898
List<object> list = (List<object>)eventLog.Values[0];
9999
Assert.Equal(3, list.Count);
@@ -128,7 +128,7 @@ public async Task ReadEventLogAsyncTest()
128128
Assert.Single(eventLog.Values);
129129
Assert.NotNull(eventLog.Values[0]);
130130
Assert.IsType<List<object>>(eventLog.Values[0]);
131-
Assert.Equal($"15-11-16 09:48:40.000 707 707 0 : System.Collections.Generic.List`1[System.Object]", eventLog.ToString());
131+
Assert.Equal($"{entry.TimeStamp.LocalDateTime:yy-MM-dd HH:mm:ss.fff} 707 707 0 : System.Collections.Generic.List`1[System.Object]", eventLog.ToString());
132132

133133
List<object> list = (List<object>)eventLog.Values[0];
134134
Assert.Equal(3, list.Count);

AdvancedSharpAdbClient.Tests/Properties/GlobalUsings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
global using AdvancedSharpAdbClient.Logs.Tests;
1414
#endregion
1515

16-
#if WINDOWS10_0_18362_0_OR_GREATER
16+
#if WINDOWS10_0_17763_0_OR_GREATER
1717
global using Windows.ApplicationModel;
1818
global using System.Runtime.InteropServices.WindowsRuntime;
1919
global using Windows.Storage;

AdvancedSharpAdbClient.Tests/SyncServiceTests.Async.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public async Task StatAsyncTest()
3838
Assert.Equal((UnixFileStatus)416, value.FileMode.GetPermissions());
3939
Assert.Equal(597, value.Size);
4040
Assert.Equal(DateTimeExtensions.Epoch.ToLocalTime(), value.Time);
41-
Assert.Equal("-rw-r-----\t597\t1970/1/1 0:00:00 +00:00\t/fstab.donatello", value.ToString());
41+
Assert.Equal($"-rw-r-----\t597\t{value.Time}\t/fstab.donatello", value.ToString());
4242
}
4343

4444
/// <summary>
@@ -78,28 +78,28 @@ public async Task GetListingAsyncTest()
7878
Assert.Equal((UnixFileStatus)16873, dir.FileMode);
7979
Assert.Equal(0, dir.Size);
8080
Assert.Equal(time, dir.Time);
81-
Assert.Equal("drwxr-x--x\t0\t2015/11/3 9:47:04 +00:00\t.", dir.ToString());
81+
Assert.Equal($"drwxr-x--x\t0\t{dir.Time}\t.", dir.ToString());
8282

8383
FileStatistics parentDir = value[1];
8484
Assert.Equal("..", parentDir.Path);
8585
Assert.Equal((UnixFileStatus)16877, parentDir.FileMode);
8686
Assert.Equal(0, parentDir.Size);
8787
Assert.Equal(time, parentDir.Time);
88-
Assert.Equal("drwxr-xr-x\t0\t2015/11/3 9:47:04 +00:00\t..", parentDir.ToString());
88+
Assert.Equal($"drwxr-xr-x\t0\t{dir.Time}\t..", parentDir.ToString());
8989

9090
FileStatistics sdcard0 = value[2];
9191
Assert.Equal("sdcard0", sdcard0.Path);
9292
Assert.Equal((UnixFileStatus)41471, sdcard0.FileMode);
9393
Assert.Equal(24, sdcard0.Size);
9494
Assert.Equal(time, sdcard0.Time);
95-
Assert.Equal("lrwxrwxrwx\t24\t2015/11/3 9:47:04 +00:00\tsdcard0", sdcard0.ToString());
95+
Assert.Equal($"lrwxrwxrwx\t24\t{dir.Time}\tsdcard0", sdcard0.ToString());
9696

9797
FileStatistics emulated = value[3];
9898
Assert.Equal("emulated", emulated.Path);
9999
Assert.Equal((UnixFileStatus)16749, emulated.FileMode);
100100
Assert.Equal(0, emulated.Size);
101101
Assert.Equal(time, emulated.Time);
102-
Assert.Equal("dr-xr-xr-x\t0\t2015/11/3 9:47:04 +00:00\temulated", emulated.ToString());
102+
Assert.Equal($"dr-xr-xr-x\t0\t{dir.Time}\temulated", emulated.ToString());
103103
}
104104

105105
/// <summary>
@@ -139,24 +139,28 @@ public async Task GetAsyncListingTest()
139139
Assert.Equal((UnixFileStatus)16873, dir.FileMode);
140140
Assert.Equal(0, dir.Size);
141141
Assert.Equal(time, dir.Time);
142+
Assert.Equal($"drwxr-x--x\t0\t{dir.Time}\t.", dir.ToString());
142143

143144
FileStatistics parentDir = value[1];
144145
Assert.Equal("..", parentDir.Path);
145146
Assert.Equal((UnixFileStatus)16877, parentDir.FileMode);
146147
Assert.Equal(0, parentDir.Size);
147148
Assert.Equal(time, parentDir.Time);
149+
Assert.Equal($"drwxr-xr-x\t0\t{dir.Time}\t..", parentDir.ToString());
148150

149151
FileStatistics sdcard0 = value[2];
150152
Assert.Equal("sdcard0", sdcard0.Path);
151153
Assert.Equal((UnixFileStatus)41471, sdcard0.FileMode);
152154
Assert.Equal(24, sdcard0.Size);
153155
Assert.Equal(time, sdcard0.Time);
156+
Assert.Equal($"lrwxrwxrwx\t24\t{dir.Time}\tsdcard0", sdcard0.ToString());
154157

155158
FileStatistics emulated = value[3];
156159
Assert.Equal("emulated", emulated.Path);
157160
Assert.Equal((UnixFileStatus)16749, emulated.FileMode);
158161
Assert.Equal(0, emulated.Size);
159162
Assert.Equal(time, emulated.Time);
163+
Assert.Equal($"dr-xr-xr-x\t0\t{dir.Time}\temulated", emulated.ToString());
160164
}
161165

162166
/// <summary>

AdvancedSharpAdbClient.Tests/SyncServiceTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void StatTest()
4646
Assert.Equal((UnixFileStatus)416, value.FileMode.GetPermissions());
4747
Assert.Equal(597, value.Size);
4848
Assert.Equal(DateTimeExtensions.Epoch.ToLocalTime(), value.Time);
49-
Assert.Equal("-rw-r-----\t597\t1970/1/1 0:00:00 +00:00\t/fstab.donatello", value.ToString());
49+
Assert.Equal($"-rw-r-----\t597\t{value.Time}\t/fstab.donatello", value.ToString());
5050
}
5151

5252
/// <summary>
@@ -86,28 +86,28 @@ public void GetListingTest()
8686
Assert.Equal((UnixFileStatus)16873, dir.FileMode);
8787
Assert.Equal(0, dir.Size);
8888
Assert.Equal(time, dir.Time);
89-
Assert.Equal("drwxr-x--x\t0\t2015/11/3 9:47:04 +00:00\t.", dir.ToString());
89+
Assert.Equal($"drwxr-x--x\t0\t{dir.Time}\t.", dir.ToString());
9090

9191
FileStatistics parentDir = value[1];
9292
Assert.Equal("..", parentDir.Path);
9393
Assert.Equal((UnixFileStatus)16877, parentDir.FileMode);
9494
Assert.Equal(0, parentDir.Size);
9595
Assert.Equal(time, parentDir.Time);
96-
Assert.Equal("drwxr-xr-x\t0\t2015/11/3 9:47:04 +00:00\t..", parentDir.ToString());
96+
Assert.Equal($"drwxr-xr-x\t0\t{dir.Time}\t..", parentDir.ToString());
9797

9898
FileStatistics sdcard0 = value[2];
9999
Assert.Equal("sdcard0", sdcard0.Path);
100100
Assert.Equal((UnixFileStatus)41471, sdcard0.FileMode);
101101
Assert.Equal(24, sdcard0.Size);
102102
Assert.Equal(time, sdcard0.Time);
103-
Assert.Equal("lrwxrwxrwx\t24\t2015/11/3 9:47:04 +00:00\tsdcard0", sdcard0.ToString());
103+
Assert.Equal($"lrwxrwxrwx\t24\t{dir.Time}\tsdcard0", sdcard0.ToString());
104104

105105
FileStatistics emulated = value[3];
106106
Assert.Equal("emulated", emulated.Path);
107107
Assert.Equal((UnixFileStatus)16749, emulated.FileMode);
108108
Assert.Equal(0, emulated.Size);
109109
Assert.Equal(time, emulated.Time);
110-
Assert.Equal("dr-xr-xr-x\t0\t2015/11/3 9:47:04 +00:00\temulated", emulated.ToString());
110+
Assert.Equal($"dr-xr-xr-x\t0\t{dir.Time}\temulated", emulated.ToString());
111111
}
112112

113113
/// <summary>
@@ -239,7 +239,7 @@ public void CloneTest()
239239
socket.Responses.Enqueue(AdbResponse.OK);
240240
using SyncService syncService = new(socket, Device);
241241
Assert.True(syncService is ICloneable<ISyncService>);
242-
#if WINDOWS10_0_18362_0_OR_GREATER
242+
#if WINDOWS10_0_17763_0_OR_GREATER
243243
Assert.True(syncService is ICloneable<ISyncService.IWinRT>);
244244
#endif
245245
using SyncService service = syncService.Clone();

AdvancedSharpAdbClient/AdbClient.Async.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -957,9 +957,6 @@ public async Task InstallCommitAsync(DeviceData device, string session, Cancella
957957

958958
#if HAS_WINRT
959959
/// <inheritdoc/>
960-
#if NET
961-
[SupportedOSPlatform("Windows10.0.10240.0")]
962-
#endif
963960
public virtual async Task InstallAsync(DeviceData device, IRandomAccessStream apk, Action<InstallProgressEventArgs>? callback = null, CancellationToken cancellationToken = default, params string[] arguments)
964961
{
965962
callback?.Invoke(new InstallProgressEventArgs(PackageInstallProgressState.Preparing));
@@ -1031,9 +1028,6 @@ public virtual async Task InstallAsync(DeviceData device, IRandomAccessStream ap
10311028
}
10321029

10331030
/// <inheritdoc/>
1034-
#if HAS_WINRT && NET
1035-
[SupportedOSPlatform("Windows10.0.10240.0")]
1036-
#endif
10371031
public async Task InstallMultipleAsync(DeviceData device, IRandomAccessStream baseAPK, IEnumerable<IRandomAccessStream> splitAPKs, Action<InstallProgressEventArgs>? callback = null, CancellationToken cancellationToken = default, params string[] arguments)
10381032
{
10391033
callback?.Invoke(new InstallProgressEventArgs(PackageInstallProgressState.Preparing));
@@ -1087,9 +1081,6 @@ void OnSplitSyncProgressChanged(string? sender, double args)
10871081
}
10881082

10891083
/// <inheritdoc/>
1090-
#if HAS_WINRT && NET
1091-
[SupportedOSPlatform("Windows10.0.10240.0")]
1092-
#endif
10931084
public async Task InstallMultipleAsync(DeviceData device, IEnumerable<IRandomAccessStream> splitAPKs, string packageName, Action<InstallProgressEventArgs>? callback = null, CancellationToken cancellationToken = default, params string[] arguments)
10941085
{
10951086
callback?.Invoke(new InstallProgressEventArgs(PackageInstallProgressState.Preparing));
@@ -1133,9 +1124,6 @@ void OnSyncProgressChanged(string? sender, double args)
11331124
}
11341125

11351126
/// <inheritdoc/>
1136-
#if NET
1137-
[SupportedOSPlatform("Windows10.0.10240.0")]
1138-
#endif
11391127
public virtual async Task InstallWriteAsync(DeviceData device, IRandomAccessStream apk, string apkName, string session, Action<double>? callback = null, CancellationToken cancellationToken = default)
11401128
{
11411129
callback?.Invoke(0);
@@ -1200,9 +1188,6 @@ public virtual async Task InstallWriteAsync(DeviceData device, IRandomAccessStre
12001188
/// The progress is reported as a value between 0 and 100, representing the percentage of the apk which has been transferred.</param>
12011189
/// <param name="cancellationToken">A <see cref="CancellationToken"/> which can be used to cancel the asynchronous operation.</param>
12021190
/// <returns>A <see cref="Task"/> which represents the asynchronous operation.</returns>
1203-
#if NET
1204-
[SupportedOSPlatform("Windows10.0.10240.0")]
1205-
#endif
12061191
protected virtual async Task InstallWriteAsync(DeviceData device, IRandomAccessStream apk, string apkName, string session, Action<string?, double>? callback, CancellationToken cancellationToken = default)
12071192
{
12081193
callback?.Invoke(apkName, 0);

0 commit comments

Comments
 (0)