-
-
Notifications
You must be signed in to change notification settings - Fork 293
Expand file tree
/
Copy pathRegistrationSampleOutOfProcess.cs
More file actions
46 lines (39 loc) · 1.73 KB
/
RegistrationSampleOutOfProcess.cs
File metadata and controls
46 lines (39 loc) · 1.73 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
36
37
38
39
40
41
42
43
44
45
46
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 RegistrationSampleOutOfProcess
{
[ExcelFact(Workbook = "", AddIn = AddInPath.RegistrationSample)]
public void AsyncSleep()
{
Runner.ExecuteWithRetryWhenExcelBusy(() =>
{
Range functionRange = ((Worksheet)ExcelDna.Testing.Util.Workbook.Sheets[1]).Range["B1"];
functionRange.Formula = "=dnaDelayedHello(\"world\", 0)";
Automation.WaitFor(() => functionRange.Value?.ToString() == "Hello world!", 1000);
Assert.Equal("Hello world!", functionRange.Value.ToString());
});
Runner.ExecuteWithRetryWhenExcelBusy(() =>
{
Range functionRange = ((Worksheet)ExcelDna.Testing.Util.Workbook.Sheets[1]).Range["C1"];
functionRange.Formula = "=dnaDelayedHello(\"world\", 200)";
Automation.WaitFor(() => functionRange.Value?.ToString() == "Hello world!", 2000);
Assert.Equal("Hello world!", functionRange.Value.ToString());
});
}
[ExcelFact(Workbook = "", AddIn = AddInPath.RegistrationSample)]
public void GettingData()
{
Runner.ExecuteWithRetryWhenExcelBusy(() =>
{
Range functionRange = ((Worksheet)ExcelDna.Testing.Util.Workbook.Sheets[1]).Range["B1"];
functionRange.Formula = "=dnaDelayedHelloAsync(\"a\", 2000)";
Assert.Equal(-2146826245, functionRange.Value);
});
}
}
}