File tree 3 files changed +8
-8
lines changed
3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ public interface IHasDownloads
28
28
/// <summary>
29
29
/// Retrieves the downloadable files.
30
30
/// </summary>
31
- /// <returns>A list of file names available for download.</returns>
32
- List < string > GetDownloadableFiles ( ) ;
31
+ /// <returns>A read-only list of file names available for download.</returns>
32
+ IReadOnlyList < string > GetDownloadableFiles ( ) ;
33
33
34
34
/// <summary>
35
35
/// Downloads a file with the specified file name and returns a dictionary containing the downloaded file's data.
Original file line number Diff line number Diff line change @@ -471,10 +471,10 @@ public DevToolsSession GetDevToolsSession(int protocolVersion)
471
471
}
472
472
473
473
/// <summary>
474
- /// Retrieves the downloadable files as a map of file names and their corresponding URLs .
474
+ /// Retrieves the downloadable files.
475
475
/// </summary>
476
- /// <returns>A list containing file names as keys and URLs as values .</returns>
477
- public List < string > GetDownloadableFiles ( )
476
+ /// <returns>A read-only list of file names available for download .</returns>
477
+ public IReadOnlyList < string > GetDownloadableFiles ( )
478
478
{
479
479
var enableDownloads = this . Capabilities . GetCapability ( CapabilityType . EnableDownloads ) ;
480
480
if ( enableDownloads == null || ! ( bool ) enableDownloads ) {
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ public void CanListDownloadableFiles()
41
41
{
42
42
DownloadWithBrowser ( ) ;
43
43
44
- List < string > names = ( ( RemoteWebDriver ) driver ) . GetDownloadableFiles ( ) ;
44
+ IReadOnlyList < string > names = ( ( RemoteWebDriver ) driver ) . GetDownloadableFiles ( ) ;
45
45
Assert . That ( names , Contains . Item ( "file_1.txt" ) ) ;
46
46
Assert . That ( names , Contains . Item ( "file_2.jpg" ) ) ;
47
47
}
@@ -52,7 +52,7 @@ public void CanDownloadFile()
52
52
{
53
53
DownloadWithBrowser ( ) ;
54
54
55
- List < string > names = ( ( RemoteWebDriver ) driver ) . GetDownloadableFiles ( ) ;
55
+ IReadOnlyList < string > names = ( ( RemoteWebDriver ) driver ) . GetDownloadableFiles ( ) ;
56
56
string fileName = names [ 0 ] ;
57
57
string targetDirectory = Path . Combine ( Path . GetTempPath ( ) , Guid . NewGuid ( ) . ToString ( ) ) ;
58
58
@@ -72,7 +72,7 @@ public void CanDeleteFiles()
72
72
73
73
( ( RemoteWebDriver ) driver ) . DeleteDownloadableFiles ( ) ;
74
74
75
- List < string > names = ( ( RemoteWebDriver ) driver ) . GetDownloadableFiles ( ) ;
75
+ IReadOnlyList < string > names = ( ( RemoteWebDriver ) driver ) . GetDownloadableFiles ( ) ;
76
76
Assert . IsEmpty ( names , "The names list should be empty." ) ;
77
77
}
78
78
You can’t perform that action at this time.
0 commit comments