File tree Expand file tree Collapse file tree 4 files changed +28
-4
lines changed Expand file tree Collapse file tree 4 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ public static string ToFileSizeString(long size)
42
42
}
43
43
else
44
44
{
45
- return ( ( size >> 50 ) / 1024F ) . ToString ( "F0 " ) + " EB" ;
45
+ return ( ( size >> 50 ) / 1024F ) . ToString ( "F1 " ) + " EB" ;
46
46
}
47
47
}
48
48
}
Original file line number Diff line number Diff line change @@ -54,11 +54,11 @@ public static Task InvokeAsync<T>(this EventHandler<T>? eventHandler, object sen
54
54
invocationDelegate ( sender , eventArgs ) ;
55
55
56
56
#pragma warning disable CS0618 // Type or member is obsolete
57
- EventDeferral ? deferral = eventArgs . GetCurrentDeferralAndReset ( ) ;
57
+ EventDeferral ? deferral = eventArgs . GetCurrentDeferralAndReset ( ) ;
58
58
59
59
return deferral ? . WaitForCompletion ( cancellationToken ) ?? Task . CompletedTask ;
60
60
#pragma warning restore CS0618 // Type or member is obsolete
61
- } )
61
+ } )
62
62
. ToArray ( ) ;
63
63
64
64
return Task . WhenAll ( tasks ) ;
Original file line number Diff line number Diff line change @@ -29,5 +29,5 @@ public interface IIncrementalSource<TSource>
29
29
/// <returns>
30
30
/// Returns a collection of <typeparamref name="TSource"/>.
31
31
/// </returns>
32
- Task < IEnumerable < TSource > > GetPagedItemsAsync ( int pageIndex , int pageSize , CancellationToken cancellationToken = default ( CancellationToken ) ) ;
32
+ Task < IEnumerable < TSource > > GetPagedItemsAsync ( int pageIndex , int pageSize , CancellationToken cancellationToken = default ) ;
33
33
}
Original file line number Diff line number Diff line change
1
+ // Licensed to the .NET Foundation under one or more agreements.
2
+ // The .NET Foundation licenses this file to you under the MIT license.
3
+ // See the LICENSE file in the project root for more information.
4
+
5
+ using Microsoft . VisualStudio . TestTools . UnitTesting ;
6
+
7
+ namespace CommunityToolkit . Common . UnitTests ;
8
+
9
+ [ TestClass ]
10
+ public class Test_Converters
11
+ {
12
+ [ TestMethod ]
13
+ [ DataRow ( 1024L - 1 , "1023 bytes" ) ]
14
+ [ DataRow ( 1024L , "1.0 KB" ) ]
15
+ [ DataRow ( 1024L * 1024 , "1.0 MB" ) ]
16
+ [ DataRow ( 1024L * 1024 * 1024 , "1.0 GB" ) ]
17
+ [ DataRow ( 1024L * 1024 * 1024 * 1024 , "1.0 TB" ) ]
18
+ [ DataRow ( 1024L * 1024 * 1024 * 1024 * 1024 , "1.0 PB" ) ]
19
+ [ DataRow ( 1024L * 1024 * 1024 * 1024 * 1024 * 1024 , "1.0 EB" ) ]
20
+ public void Test_ToFileSizeString ( long size , string expected )
21
+ {
22
+ Assert . AreEqual ( expected , Converters . ToFileSizeString ( size ) ) ;
23
+ }
24
+ }
You can’t perform that action at this time.
0 commit comments