worker 和进度相关

This commit is contained in:
龙腾猫跃 committed 2026-06-28 10:49:57 +08:00
1 parent 93e2f5cde8
commit dbdbfcebd2
5 files changed
+67 -50

No files matched your search

+1 -1
View File
@@ -40,7 +40,7 @@ public class ProgressTest : TestBase {
progress.Set(0.75, skiped: true);
await Assert.That(changedCount).IsEqualTo(2);
await Assert.That(Math.Abs(progress.Observe() - 2.0 / 3) < 0.000001).IsTrue();
await Assert.That(Math.Abs(progress.GetIncrement() - 2.0 / 3) < 0.000001).IsTrue();
}
[Test]
+2 -2
View File
@@ -21,11 +21,11 @@ public class TaskUtilsTest : TestBase {
], progress);
await Assert.That(ReferenceEquals(firstProgress, secondProgress)).IsFalse();
await Assert.That(progress.Observe()).IsEqualTo(0.5);
await Assert.That(progress.GetIncrement()).IsEqualTo(0.5);
continueSecond.SetResult(null);
var results = await whenAll;
await Assert.That(string.Join(",", results)).IsEqualTo("1,2");
await Assert.That(progress.Observe()).IsEqualTo(1);
await Assert.That(progress.GetIncrement()).IsEqualTo(1);
}
[Test]