From 18b1b51d07c8a01bc274e53e90e1743686b24611 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 8 Mar 2022 10:56:24 +0100 Subject: [PATCH] C#: Add test for known sources telemetry query. --- .../SupportedExternalSources.cs | 12 ++++++++++++ .../SupportedExternalSources.expected | 2 ++ .../SupportedExternalSources.qlref | 1 + 3 files changed, 15 insertions(+) create mode 100644 csharp/ql/test/query-tests/Telemetry/SupportedExternalSources/SupportedExternalSources.cs create mode 100644 csharp/ql/test/query-tests/Telemetry/SupportedExternalSources/SupportedExternalSources.expected create mode 100644 csharp/ql/test/query-tests/Telemetry/SupportedExternalSources/SupportedExternalSources.qlref diff --git a/csharp/ql/test/query-tests/Telemetry/SupportedExternalSources/SupportedExternalSources.cs b/csharp/ql/test/query-tests/Telemetry/SupportedExternalSources/SupportedExternalSources.cs new file mode 100644 index 00000000000..2a4ea1fdb61 --- /dev/null +++ b/csharp/ql/test/query-tests/Telemetry/SupportedExternalSources/SupportedExternalSources.cs @@ -0,0 +1,12 @@ +using System; + +public class SupportExternalSources +{ + public void M1() + { + var l1 = Console.ReadLine(); // Known source. + var l2 = Console.ReadLine(); // Known source. + Console.SetError(Console.Out); + var x = Console.Read(); // Know source. + } +} diff --git a/csharp/ql/test/query-tests/Telemetry/SupportedExternalSources/SupportedExternalSources.expected b/csharp/ql/test/query-tests/Telemetry/SupportedExternalSources/SupportedExternalSources.expected new file mode 100644 index 00000000000..0f125b04b94 --- /dev/null +++ b/csharp/ql/test/query-tests/Telemetry/SupportedExternalSources/SupportedExternalSources.expected @@ -0,0 +1,2 @@ +| System.Console.dll#System#Console.ReadLine() | 2 | +| System.Console.dll#System#Console.Read() | 1 | diff --git a/csharp/ql/test/query-tests/Telemetry/SupportedExternalSources/SupportedExternalSources.qlref b/csharp/ql/test/query-tests/Telemetry/SupportedExternalSources/SupportedExternalSources.qlref new file mode 100644 index 00000000000..c6819c7775f --- /dev/null +++ b/csharp/ql/test/query-tests/Telemetry/SupportedExternalSources/SupportedExternalSources.qlref @@ -0,0 +1 @@ +Telemetry/SupportedExternalSources.ql