Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/mehrandvd/skunit
Browse files Browse the repository at this point in the history
  • Loading branch information
mehrandvd committed Sep 30, 2024
2 parents c589819 + 882c25e commit c950988
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ Executing tests is a straightforward process. You have the flexibility to utiliz
```csharp
var markdown = // Load it from .md file
var scenarios = await ChatScenario.LoadFromText(markdown);
await SemanticKernelAssert.CheckChatScenarioAsync(scenarios, async history =>
await ScenarioAssert.PassAsync(scenarios,
getAnswerFunc: async history =>
{
var result = // your logic to be tested;
return result;
Expand Down Expand Up @@ -199,18 +200,18 @@ Afterwards, you'll need to instantiate the `SemanticKernelAssert` class in your
```csharp
public class MyTest
{
SemanticKernelAssert SemanticKernelAssert { get; set; }
SemanticAssert SemanticAssert { get; set; }
MyTest(ITestOutputHelper output)
{
SemanticKernelAssert = new SemanticKernelAssert(_deploymentName, _endpoint, _apiKey, output.WriteLine);
SemanticAssert = new SemanticAssert(_deploymentName, _endpoint, _apiKey, output.WriteLine);
}

[Fact]
TestChat()
{
var scenario = // Load your markdown.
var scenarios = await ChatScenario.LoadFromTest(scenario);
await SemanticKernelAssert.CheckChatScenarioAsync(scenarios, async history =>
await SemanticAssert.PassAsync(scenarios, async history =>
{
var result = // your logic to be tested;
return result;
Expand Down

0 comments on commit c950988

Please sign in to comment.