Skip to content

Commit

Permalink
Simplify Dispose() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
awaescher committed Jan 3, 2025
1 parent a5d641b commit ad264ee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/FunctionalTests/ChatTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public async Task Setup()
[TearDown]
public Task Teardown()
{
((IChatClient?)_client)?.Dispose();
_client?.Dispose();
return Task.CompletedTask;
}

Expand Down
2 changes: 1 addition & 1 deletion test/FunctionalTests/OllamaApiClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public async Task Setup()
public async Task Teardown()
{
await CleanupModel(_localModel);
((IChatClient?)_client)?.Dispose();
_client?.Dispose();
}

private async Task CleanupModel(string? model = null)
Expand Down
2 changes: 1 addition & 1 deletion test/OllamaApiClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void SetUp()
[OneTimeTearDown]
public void OneTimeTearDown()
{
((IDisposable)_client).Dispose();
_client.Dispose();
}

/// <summary>
Expand Down

0 comments on commit ad264ee

Please sign in to comment.