-
-
Notifications
You must be signed in to change notification settings - Fork 293
Expand file tree
/
Copy pathRegistrationOutOfProcess.cs
More file actions
35 lines (29 loc) · 1.28 KB
/
RegistrationOutOfProcess.cs
File metadata and controls
35 lines (29 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using ExcelDna.Testing;
using Microsoft.Office.Interop.Excel;
using Range = Microsoft.Office.Interop.Excel.Range;
namespace ExcelDna.RuntimeTests
{
[ExcelTestSettings(OutOfProcess = true)]
[Collection("OutOfProcess")]
public class RegistrationOutOfProcess
{
[ExcelFact(Workbook = "", AddIn = AddInPath.RuntimeTests)]
public void AsyncSleep()
{
Runner.ExecuteWithRetryWhenExcelBusy(() =>
{
Range functionRange = ((Worksheet)ExcelDna.Testing.Util.Workbook.Sheets[1]).Range["B1"];
functionRange.Formula = "=MyAsyncHello(\"world\", 0)";
Automation.WaitFor(() => functionRange.Value?.ToString() == "Hello async world", 1000);
Assert.Equal("Hello async world", functionRange.Value.ToString());
});
Runner.ExecuteWithRetryWhenExcelBusy(() =>
{
Range functionRange = ((Worksheet)ExcelDna.Testing.Util.Workbook.Sheets[1]).Range["C1"];
functionRange.Formula = "=MyAsyncHello(\"world\", 200)";
Automation.WaitFor(() => functionRange.Value?.ToString() == "Hello async world", 2000);
Assert.Equal("Hello async world", functionRange.Value.ToString());
});
}
}
}