|
1 | | -using NUnit.Framework; |
2 | | -using System; |
3 | | -using System.Collections.Generic; |
4 | | -using System.Linq; |
5 | | -using System.Text; |
6 | | -using System.Threading.Tasks; |
| 1 | +using System.Collections.Generic; |
| 2 | +using FirebirdSql.Data.Client.Managed; |
| 3 | +using NUnit.Framework; |
7 | 4 |
|
8 | 5 | namespace FirebirdSql.Data.FirebirdClient.Tests |
9 | 6 | { |
10 | 7 | [TestFixture] |
11 | | - class GdsConnectionTests |
| 8 | + public class GdsConnectionTests |
12 | 9 | { |
13 | | - [Test, TestCaseSource(typeof(NormalizeLoginTestData), "TestCases")] |
14 | | - public string NormalizeLoginTest(string login) |
| 10 | + static IEnumerable<TestCaseData> NormalizeLoginTestSource() |
15 | 11 | { |
16 | | - return Client.Managed.GdsConnection.NormalizeLogin(login); |
| 12 | + yield return new TestCaseData("sysdba").Returns("SYSDBA"); |
| 13 | + yield return new TestCaseData("s").Returns("S"); |
| 14 | + yield return new TestCaseData("\"CaseSensitive\"").Returns("CaseSensitive"); |
| 15 | + yield return new TestCaseData("\"s\"").Returns("s"); |
| 16 | + yield return new TestCaseData("\"With\"\"EscapedQuote\"").Returns("With\"EscapedQuote"); |
| 17 | + yield return new TestCaseData("\"Invalid\"Escape\"").Returns("Invalid"); |
| 18 | + yield return new TestCaseData("\"DanglingInvalidEscape\"\"").Returns("DanglingInvalidEscape"); |
| 19 | + yield return new TestCaseData("\"EscapedQuoteAtEnd\"\"\"").Returns("EscapedQuoteAtEnd\""); |
| 20 | + yield return new TestCaseData("\"StartNoEndQuote").Returns("\"STARTNOENDQUOTE"); |
| 21 | + yield return new TestCaseData("\"\"").Returns("\"\""); |
| 22 | + yield return new TestCaseData("").Returns(""); |
| 23 | + yield return new TestCaseData(null).Returns(null); |
17 | 24 | } |
18 | | - } |
19 | | - |
20 | | - class NormalizeLoginTestData |
21 | | - { |
22 | | - public static IEnumerable<TestCaseData> TestCases |
| 25 | + [TestCaseSource(nameof(NormalizeLoginTestSource))] |
| 26 | + public string NormalizeLoginTest(string login) |
23 | 27 | { |
24 | | - get |
25 | | - { |
26 | | - yield return new TestCaseData("sysdba").Returns("SYSDBA"); |
27 | | - yield return new TestCaseData("s").Returns("S"); |
28 | | - yield return new TestCaseData("\"CaseSensitive\"").Returns("CaseSensitive"); |
29 | | - yield return new TestCaseData("\"s\"").Returns("s"); |
30 | | - yield return new TestCaseData("\"With\"\"EscapedQuote\"").Returns("With\"EscapedQuote"); |
31 | | - yield return new TestCaseData("\"Invalid\"Escape\"").Returns("Invalid"); |
32 | | - yield return new TestCaseData("\"DanglingInvalidEscape\"\"").Returns("DanglingInvalidEscape"); |
33 | | - yield return new TestCaseData("\"EscapedQuoteAtEnd\"\"\"").Returns("EscapedQuoteAtEnd\""); |
34 | | - yield return new TestCaseData("\"StartNoEndQuote").Returns("\"STARTNOENDQUOTE"); |
35 | | - yield return new TestCaseData("\"\"").Returns("\"\""); |
36 | | - yield return new TestCaseData("").Returns(""); |
37 | | - yield return new TestCaseData(null).Returns(null); |
38 | | - } |
| 28 | + return GdsConnection.NormalizeLogin(login); |
39 | 29 | } |
40 | 30 | } |
41 | 31 | } |
0 commit comments