Updated tests and corrected found errors in Vanara.BITS

pull/267/head
dahall 2021-12-11 09:05:58 -07:00
parent 61931b1e83
commit 99ba5422b9
3 changed files with 5 additions and 3 deletions

View File

@ -307,7 +307,7 @@ namespace Vanara.IO
/// be set before the first call to IBackgroundCopyJob::Resume that starts the job. /// be set before the first call to IBackgroundCopyJob::Resume that starts the job.
/// </para> /// </para>
/// </remarks> /// </remarks>
[DefaultValue(null)] [DefaultValue("GET")]
public string HttpMethod public string HttpMethod
{ {
get => RunAction(() => IHttpOp2.GetHttpMethod()); get => RunAction(() => IHttpOp2.GetHttpMethod());

View File

@ -31,7 +31,7 @@ namespace Vanara.IO
static Version GetVer() static Version GetVer()
{ {
var fi = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "qmgr.dll")); var fi = System.Diagnostics.FileVersionInfo.GetVersionInfo(Environment.ExpandEnvironmentVariables(@"%WinDir%\sysnative\qmgr.dll"));
return $"{fi.FileMajorPart}.{fi.FileMinorPart}" switch return $"{fi.FileMajorPart}.{fi.FileMinorPart}" switch
{ {
"7.8" when fi.FileBuildPart >= 18362 => new Version(10, 3), "7.8" when fi.FileBuildPart >= 18362 => new Version(10, 3),

View File

@ -50,6 +50,9 @@ namespace Vanara.IO.Tests
Assert.That(() => job.HighPerformance = true, Throws.Nothing); Assert.That(() => job.HighPerformance = true, Throws.Nothing);
Assert.That(job.HighPerformance, Is.EqualTo(true)); Assert.That(job.HighPerformance, Is.EqualTo(true));
Assert.That(job.HttpMethod, Is.EqualTo(job.GetDefVal<string>(nameof(job.HttpMethod))));
Assert.That(() => job.MakeCustomHeadersWriteOnly(), Throws.Nothing);
Assert.That(job.ID, Is.Not.EqualTo(Guid.Empty)); Assert.That(job.ID, Is.Not.EqualTo(Guid.Empty));
Assert.That(job.JobType, Is.EqualTo(BackgroundCopyJobType.Download)); Assert.That(job.JobType, Is.EqualTo(BackgroundCopyJobType.Download));
@ -90,7 +93,6 @@ namespace Vanara.IO.Tests
Assert.That(() => job.OnDemand = true, Throws.Nothing); Assert.That(() => job.OnDemand = true, Throws.Nothing);
Assert.That(job.OnDemand, Is.EqualTo(true)); Assert.That(job.OnDemand, Is.EqualTo(true));
using var identity = WindowsIdentity.GetCurrent(); using var identity = WindowsIdentity.GetCurrent();
Assert.That(job.Owner, Is.EqualTo(identity.User)); Assert.That(job.Owner, Is.EqualTo(identity.User));