Commit 86f88bc
fix(csharp): enforce minimum batch size of 1 in test configuration (#52)
## Summary
This PR resolves a contradiction in batch size validation logic where PR
#48 incorrectly allowed `batchSize >= 0` to workaround fractional batch
size test calculations.
## Problem
- Base class test in `StatementTests.cs` expects `[InlineData("0",
true)]` - meaning batchSize=0 should throw an exception
- PR #48 changed `DatabricksStatement.cs` to ALLOW `batchSize >= 0` to
pass tests with fractional factors (0.25, 0.1)
- Fractional calculations like `(long)(2 * 0.1) = 0` resulted in zero
batch size
- This violates semantic correctness - batch size must be > 0
## Solution
1. **DatabricksStatement.cs**: Revert validation to correctly reject
`batchSize <= 0`
2. **DatabricksTestConfiguration.cs**: Add `BatchSize` property that
converts "0" to "1" in the setter
This ensures:
- Semantic correctness maintained (batch size must be > 0)
- Fractional test calculations produce minimum value of 1 instead of 0
- Base class test expecting exception for explicit batchSize="0" will
pass
## Testing
- All DriverTests pass with various batch size factors (0.1, 0.25, 1.0,
2.0, null)
- Build successful with 0 warnings, 0 errors
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude <[email protected]>1 parent a97aff2 commit 86f88bc
File tree
5 files changed
+61
-9
lines changed- .github/workflows
- ci/scripts
- csharp
- src
- test
- E2E
- Resources
5 files changed
+61
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
| |||
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
69 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
70 | 81 | | |
71 | 82 | | |
72 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
| 26 | + | |
| 27 | + | |
28 | 28 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
56 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
57 | 67 | | |
58 | 68 | | |
59 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
132 | 163 | | |
133 | 164 | | |
134 | 165 | | |
| |||
0 commit comments