Skip to content

Commit 6df9a1f

Browse files
Copilotrogerbarreto
andcommitted
Make PromptExecutionSettingsCloneWorksAsExpected a Theory to test both ThinkingBudget and ThinkingLevel, restore Freeze test
Co-authored-by: rogerbarreto <[email protected]>
1 parent 20705e0 commit 6df9a1f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

dotnet/src/Connectors/Connectors.Google.UnitTests/GeminiPromptExecutionSettingsTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,10 @@ public void ItCreatesGeminiExecutionSettingsFromJsonSnakeCaseWithThinkingLevel()
183183
Assert.Equal("high", executionSettings.ThinkingConfig?.ThinkingLevel);
184184
}
185185

186-
[Fact]
187-
public void PromptExecutionSettingsCloneWorksAsExpected()
186+
[Theory]
187+
[InlineData("""{ "thinking_budget": 1000 }""")]
188+
[InlineData("""{ "thinking_level": "high" }""")]
189+
public void PromptExecutionSettingsCloneWorksAsExpected(string thinkingConfigJson)
188190
{
189191
// Arrange
190192
var category = GeminiSafetyCategory.Harassment;
@@ -205,9 +207,7 @@ public void PromptExecutionSettingsCloneWorksAsExpected()
205207
"threshold": "{{threshold.Label}}"
206208
}
207209
],
208-
"thinking_config": {
209-
"thinking_level": "high"
210-
}
210+
"thinking_config": {{thinkingConfigJson}}
211211
}
212212
""";
213213
var executionSettings = JsonSerializer.Deserialize<GeminiPromptExecutionSettings>(json);
@@ -249,7 +249,7 @@ public void PromptExecutionSettingsFreezeWorksAsExpected()
249249
}
250250
],
251251
"thinking_config": {
252-
"thinking_level": "high"
252+
"thinking_budget": 1000
253253
}
254254
}
255255
""";
@@ -266,6 +266,6 @@ public void PromptExecutionSettingsFreezeWorksAsExpected()
266266
Assert.Throws<InvalidOperationException>(() => executionSettings.AudioTimestamp = false);
267267
Assert.Throws<NotSupportedException>(() => executionSettings.StopSequences!.Add("baz"));
268268
Assert.Throws<NotSupportedException>(() => executionSettings.SafetySettings!.Add(new GeminiSafetySetting(GeminiSafetyCategory.Toxicity, GeminiSafetyThreshold.Unspecified)));
269-
Assert.Throws<InvalidOperationException>(() => executionSettings.ThinkingConfig = new GeminiThinkingConfig { ThinkingLevel = "low" });
269+
Assert.Throws<InvalidOperationException>(() => executionSettings.ThinkingConfig = new GeminiThinkingConfig { ThinkingBudget = 1 });
270270
}
271271
}

0 commit comments

Comments
 (0)