-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathRealTimeTestRunnerTest.cs
More file actions
61 lines (50 loc) · 1.86 KB
/
RealTimeTestRunnerTest.cs
File metadata and controls
61 lines (50 loc) · 1.86 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Oracle.ManagedDataAccess.Client;
using System.Collections.Generic;
using System.Linq;
namespace utPLSQL
{
[TestClass]
public class RealTimeTestRunnerTest
{
[TestMethod]
public void TestToscamtest()
{
var testRunner = new RealTimeTestRunner();
testRunner.Connect(username: "toscamtest", password: "toscamtest", database: "CA40");
testRunner.RunTestsWithCoverage(type: "USER", owner: null, name: "toscamtest", procedure: null, coverageSchemas: "'toscam'", "'pa_m720','pa_m770'", null);
var events = new List<@event>();
testRunner.ConsumeResult(@event =>
{
events.Add(@event);
});
Assert.AreEqual("pre-run", events[0].type);
Assert.AreEqual("post-run", events.Last().type);
var report = testRunner.GetCoverageReport();
System.Diagnostics.Trace.WriteLine(report);
}
[TestMethod]
public void TestGetVersion()
{
var testRunner = new RealTimeTestRunner();
testRunner.Connect(username: "toscamtest", password: "toscamtest", database: "CA40");
string version = testRunner.GetVersion();
Assert.AreEqual("v3.1.7.3096", version);
}
[TestMethod]
public void TestGetVersionWhenNotInstalled()
{
var testRunner = new RealTimeTestRunner();
testRunner.Connect(username: "c##sakila", password: "sakila", database: "ORCLCDB");
try
{
string version = testRunner.GetVersion();
Assert.Fail();
}
catch (OracleException e)
{
Assert.AreEqual("ORA-00904: \"UT\".\"VERSION\": ungültige ID", e.Message);
}
}
}
}