2022-09-05 15:31:02 -04:00
|
|
|
|
using System.IO;
|
2019-12-30 17:37:29 -05:00
|
|
|
|
|
2022-09-01 15:36:37 -04:00
|
|
|
|
namespace Vanara.PInvoke.Tests;
|
|
|
|
|
|
2022-09-05 15:31:02 -04:00
|
|
|
|
internal partial class BackgroundCopyTests
|
2019-12-30 17:37:29 -05:00
|
|
|
|
{
|
2022-09-01 15:36:37 -04:00
|
|
|
|
[Test]
|
|
|
|
|
public void CopyTest()
|
2019-12-30 17:37:29 -05:00
|
|
|
|
{
|
2022-09-01 15:36:37 -04:00
|
|
|
|
using var tempRoot = new TemporaryDirectory();
|
2019-12-30 17:37:29 -05:00
|
|
|
|
|
2022-09-01 15:36:37 -04:00
|
|
|
|
var srcFile = tempRoot.CreateFile().FullName;
|
2019-12-30 17:37:29 -05:00
|
|
|
|
|
2022-09-01 15:36:37 -04:00
|
|
|
|
var dstFile = tempRoot.RandomTxtFileFullPath;
|
2019-12-30 17:37:29 -05:00
|
|
|
|
|
2022-09-01 15:36:37 -04:00
|
|
|
|
Assert.That(() => BackgroundCopyManager.Copy(srcFile, dstFile), Throws.Nothing);
|
2019-12-30 17:37:29 -05:00
|
|
|
|
|
2022-09-01 15:36:37 -04:00
|
|
|
|
Assert.That(File.Exists(dstFile));
|
2019-12-30 17:37:29 -05:00
|
|
|
|
}
|
2022-09-05 15:31:02 -04:00
|
|
|
|
}
|