PowerShell/test
Mark Kraus d20d53eaac Add -Resume Feature to Web Cmdlets (#6447)
Fixes #5964

Adds -Resume switch to Invoke-WebRequest and Invoke-RestMethod

-Resume requires -OutFile

Enables the ability to resume downloading a partially or incompletely downloaded file.

File Size is the only indicator of local and remote file parity.

If the local file is smaller than the remote file and the remote endpoint supports resume, the local file will be appended with the remaining bytes.

If the local file is larger than the remote file, the local file will be overwritten

If the remote server does not support resume, the local file will be overwritten

If the local file is the same size as the remote file, the remote endpoint will return a 416 status code. This response is special-cased as a success in this instance. The local file remains untouched and it is assumed the file was already successfully downloaded previously.

If the local file does not exist it will be created and the entire remote file will be requested.

Added tests for all code new code paths (I'm pretty sure anyway)

Added /Resume Controller to WebListener

Documented /Resume Controller

Updated .spelling to reflect terms in WebListener docs

Note: I had to change the way GetResponse() tracks the current URI as we now have 3 places where the call is taking place. I don't foresee this causing any regressions. This area needs some refactoring. especially if we want to implement a retry mechanism
2018-03-26 12:23:24 -07:00
..
common/markdown fix secret and JavaScript compliance issues (#6408) 2018-03-16 18:05:32 -07:00
csharp Update copyright and license headers (#6134) 2018-02-13 09:23:53 -08:00
docker/networktest Update copyright and license headers (#6134) 2018-02-13 09:23:53 -08:00
powershell Add -Resume Feature to Web Cmdlets (#6447) 2018-03-26 12:23:24 -07:00
shebang Reorganize tests 2016-01-14 17:00:06 -08:00
tools Add -Resume Feature to Web Cmdlets (#6447) 2018-03-26 12:23:24 -07:00
README.md Add test/README.md 2016-03-30 23:30:26 -07:00
Test.Common.props Update to DotNet 2.0.6 (#6403) 2018-03-15 14:54:00 -07:00

Testing

The tests are organized by testing language. Thus Pester tests, which are written in the PowerShell language, are in ./powershell and xUnit tests, written in C#, are in ./csharp. The sanity tests for the Full .NET build of PowerShell are in ./fullclr, and the third-party shebang test is in ./shebang.