PathUtils.IsParentOf
This commit is contained in:
1 parent
0a3b21505a
commit
a1fcb5241a
6 files changed
+20
-18
No files matched your search
@@ -6,7 +6,7 @@ public class ProgressTest : TestBase {
|
||||
public async Task ProgressChanged_主进度实际改变时触发() {
|
||||
var progress = new ProgressProvider();
|
||||
int changedCount = 0;
|
||||
progress.ProgressChanged += () => changedCount++;
|
||||
progress.ProgressChanged += _ => changedCount++;
|
||||
|
||||
progress.Set(0.2);
|
||||
progress.Set(0.2);
|
||||
@@ -21,7 +21,7 @@ public class ProgressTest : TestBase {
|
||||
public async Task ProgressChanged_子进度改变时向父级传播() {
|
||||
var progress = new ProgressProvider();
|
||||
int changedCount = 0;
|
||||
progress.ProgressChanged += () => changedCount++;
|
||||
progress.ProgressChanged += _ => changedCount++;
|
||||
|
||||
var sub = progress.SplitBy(0.5).Single();
|
||||
sub.Set(0.5);
|
||||
@@ -34,7 +34,7 @@ public class ProgressTest : TestBase {
|
||||
public async Task ProgressChanged_不会触发Observe() {
|
||||
var progress = new ProgressProvider();
|
||||
int changedCount = 0;
|
||||
progress.ProgressChanged += () => changedCount++;
|
||||
progress.ProgressChanged += _ => changedCount++;
|
||||
|
||||
progress.Set(0.5);
|
||||
progress.Set(0.75, skiped: true);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class WorkerTest : TestBase {
|
||||
if (currentRun == 1) {
|
||||
firstStarted.Set();
|
||||
while (true) {
|
||||
ct.ThrowIfCancellationRequested();
|
||||
ct?.ThrowIfCancellationRequested();
|
||||
Thread.Sleep(10);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,14 +30,10 @@ public class FileUtilsTest : TestWithFolder {
|
||||
[Test]
|
||||
[Arguments("Corrupted.zip")]
|
||||
[Arguments("Not zip.zip")]
|
||||
public void 解压_ReadBad(string testFile)
|
||||
=> Assert.Throws<InvalidDataException>(() => FileUtils.ExtractToDirectory(GetTestFile(testFile), tempFolder));
|
||||
|
||||
[Test]
|
||||
[Arguments("DotDot ZipSlip.zip")]
|
||||
[Arguments("AbsPath ZipSlip.zip")]
|
||||
public void 解压_ZipSlip(string testFile)
|
||||
=> Assert.Throws<FileUtils.ZipSlipException>(() => FileUtils.ExtractToDirectory(GetTestFile(testFile), tempFolder));
|
||||
public void 解压_ReadBad(string testFile)
|
||||
=> Assert.Throws<InvalidDataException>(() => FileUtils.ExtractToDirectory(GetTestFile(testFile), tempFolder));
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in new issue
Block a user