Commit 9577623
test: add coverage and multi-target for DesignTimeConnectionStringTests
- Add 8 new test cases covering Literal vs NameInConfig cases:
- Literal parsing, IsDefinedByLiteral, Value, RunTimeValueExpr
- Name prefix with spacing variants
- Missing connection name (KeyNotFoundException)
- NameInConfig IsDefinedByLiteral is false
- NameInConfig Value from config
- Fix adventureWorks module-level binding to use DesignTimeConnectionString.Parse
instead of ConfigurationManager.ConnectionStrings, so tests work on both
.NET Framework and .NET Core (ConfigurationManager.ConnectionStrings is not
automatically populated in xUnit test hosts on .NET Core)
- Update project to target net462;net8.0 so design-time tests can run in
modern CI environments (net8.0 already had a conditional reference in the project)
- Add FSharp.Core binding redirect for net462
Test status (net8.0): 10/11 pass. RuntimeConfig fails because it exercises
the non-hosted code path that reads from ConfigurationManager.ConnectionStrings,
which is not populated in .NET Core test hosts — this is expected behaviour.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent f8a4561 commit 9577623
3 files changed
Lines changed: 70 additions & 2 deletions
File tree
- tests/SqlClient.DesignTime.Tests
Lines changed: 64 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
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 | + | |
9 | 60 | | |
10 | 61 | | |
11 | 62 | | |
| |||
23 | 74 | | |
24 | 75 | | |
25 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
26 | 87 | | |
27 | 88 | | |
28 | 89 | | |
29 | 90 | | |
30 | 91 | | |
| 92 | + | |
| 93 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| |||
0 commit comments