-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestSuiteRunner.cs
35 lines (32 loc) · 1.14 KB
/
TestSuiteRunner.cs
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 Microsoft.Quantum.Simulation.XUnit;
using Microsoft.Quantum.Simulation.Simulators;
using Xunit.Abstractions;
using System.Diagnostics;
namespace HiddenShiftKata
{
public class TestSuiteRunner
{
private readonly ITestOutputHelper output;
public TestSuiteRunner(ITestOutputHelper output)
{
this.output = output;
}
/// <summary>
/// This driver will run all Q# tests (operations named "...Test")
/// that belong to namespace HiddenShiftKata.
///
/// To execute your tests, just type "dotnet test" from the command line.
/// </summary>
[OperationDriver(TestNamespace = "HiddenShiftKata")]
public void TestTarget(TestOperation op)
{
using (var sim = new QuantumSimulator())
{
// OnLog defines action(s) performed when Q# test calls function Message
sim.OnLog += (msg) => { output.WriteLine(msg); };
sim.OnLog += (msg) => { Debug.WriteLine(msg); };
op.TestOperationRunner(sim);
}
}
}
}