diff --git a/dotnet/src/IntegrationTests/Data/BaseTextSearchTests.cs b/dotnet/src/IntegrationTests/Data/BaseTextSearchTests.cs
index cb9bdfa2e85b..87c7b3a521cd 100644
--- a/dotnet/src/IntegrationTests/Data/BaseTextSearchTests.cs
+++ b/dotnet/src/IntegrationTests/Data/BaseTextSearchTests.cs
@@ -18,7 +18,9 @@ namespace SemanticKernel.IntegrationTests.Data;
///
public abstract class BaseTextSearchTests : BaseIntegrationTest
{
- [Fact(Skip = "For manual verification only.")]
+ private const string SkipReason = "For manual verification only.";
+
+ [Fact(Skip = SkipReason)]
public virtual async Task CanSearchAsync()
{
// Arrange
@@ -42,7 +44,7 @@ public virtual async Task CanSearchAsync()
}
}
- [Fact(Skip = "For manual verification only.")]
+ [Fact(Skip = SkipReason)]
public virtual async Task CanGetTextSearchResultsAsync()
{
// Arrange
@@ -72,7 +74,7 @@ public virtual async Task CanGetTextSearchResultsAsync()
}
}
- [Fact(Skip = "For manual verification only.")]
+ [Fact(Skip = SkipReason)]
public virtual async Task CanGetSearchResultsAsync()
{
// Arrange
@@ -92,7 +94,7 @@ public virtual async Task CanGetSearchResultsAsync()
Assert.True(this.VerifySearchResults(results, query));
}
- [Fact(Skip = "For manual verification only.")]
+ [Fact(Skip = SkipReason)]
public virtual async Task UsingTextSearchWithAFilterAsync()
{
// Arrange
@@ -113,7 +115,7 @@ public virtual async Task UsingTextSearchWithAFilterAsync()
Assert.True(this.VerifySearchResults(results, query, filter));
}
- [Fact(Skip = "For manual verification only.")]
+ [Fact(Skip = SkipReason)]
public virtual async Task FunctionCallingUsingCreateWithSearchAsync()
{
// Arrange
@@ -142,7 +144,7 @@ public virtual async Task FunctionCallingUsingCreateWithSearchAsync()
Assert.NotEmpty(results);
}
- [Fact(Skip = "For manual verification only.")]
+ [Fact(Skip = SkipReason)]
public virtual async Task FunctionCallingUsingCreateWithGetSearchResultsAsync()
{
// Arrange
@@ -171,7 +173,7 @@ public virtual async Task FunctionCallingUsingCreateWithGetSearchResultsAsync()
Assert.NotEmpty(results);
}
- [Fact(Skip = "For manual verification only.")]
+ [Fact(Skip = SkipReason)]
public virtual async Task FunctionCallingUsingGetTextSearchResultsAsync()
{
// Arrange
diff --git a/dotnet/src/IntegrationTests/Plugins/Web/Brave/BraveTextSearchTests.cs b/dotnet/src/IntegrationTests/Plugins/Web/Brave/BraveTextSearchTests.cs
new file mode 100644
index 000000000000..466a250f9fd9
--- /dev/null
+++ b/dotnet/src/IntegrationTests/Plugins/Web/Brave/BraveTextSearchTests.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft. All rights reserved.
+
+using System.Threading.Tasks;
+using Microsoft.Extensions.Configuration;
+using Microsoft.SemanticKernel.Data;
+using Microsoft.SemanticKernel.Plugins.Web.Brave;
+using SemanticKernel.IntegrationTests.Data;
+using SemanticKernel.IntegrationTests.TestSettings;
+using Xunit;
+
+namespace SemanticKernel.IntegrationTests.Plugins.Web.Brave;
+
+///
+/// Integration tests for .
+///
+public class BraveTextSearchTests : BaseTextSearchTests
+{
+ ///
+ public override Task CreateTextSearchAsync()
+ {
+ var configuration = this.Configuration.GetSection("Brave").Get();
+ Assert.NotNull(configuration);
+ Assert.NotNull(configuration.ApiKey);
+
+ return Task.FromResult(new BraveTextSearch(apiKey: configuration.ApiKey));
+ }
+
+ ///
+ public override string GetQuery() => "What is the Semantic Kernel?";
+
+ ///
+ public override TextSearchFilter GetTextSearchFilter() => new TextSearchFilter().Equality("search_lang", "de");
+
+ ///
+ public override bool VerifySearchResults(object[] results, string query, TextSearchFilter? filter = null)
+ {
+ Assert.NotNull(results);
+ Assert.NotEmpty(results);
+ Assert.Equal(4, results.Length);
+ foreach (var result in results)
+ {
+ Assert.NotNull(result);
+ Assert.IsType(result);
+ }
+
+ return true;
+ }
+}
diff --git a/dotnet/src/IntegrationTests/TestSettings/BraveConfiguration.cs b/dotnet/src/IntegrationTests/TestSettings/BraveConfiguration.cs
new file mode 100644
index 000000000000..19b19dd3efd4
--- /dev/null
+++ b/dotnet/src/IntegrationTests/TestSettings/BraveConfiguration.cs
@@ -0,0 +1,8 @@
+// Copyright (c) Microsoft. All rights reserved.
+namespace SemanticKernel.IntegrationTests.TestSettings;
+
+#pragma warning disable CA1812 // Configuration classes are instantiated through IConfiguration.
+internal sealed class BraveConfiguration(string apiKey)
+{
+ public string ApiKey { get; init; } = apiKey;
+}
diff --git a/dotnet/src/Plugins/Plugins.UnitTests/Web/Brave/BraveTextSearchTests.cs b/dotnet/src/Plugins/Plugins.UnitTests/Web/Brave/BraveTextSearchTests.cs
index 8a98a3d81a47..68bcc3ca403e 100644
--- a/dotnet/src/Plugins/Plugins.UnitTests/Web/Brave/BraveTextSearchTests.cs
+++ b/dotnet/src/Plugins/Plugins.UnitTests/Web/Brave/BraveTextSearchTests.cs
@@ -50,12 +50,11 @@ public async Task SearchReturnsSuccessfullyAsync()
var textSearch = new BraveTextSearch(apiKey: "ApiKey", options: new() { HttpClient = this._httpClient });
// Act
- KernelSearchResults result = await textSearch.SearchAsync("What is the Semantic Kernel?", new() { Top = 10, Skip = 0 });
+ var results = textSearch.SearchAsync("What is the Semantic Kernel?", top: 10, new() { Skip = 0 });
// Assert
- Assert.NotNull(result);
- Assert.NotNull(result.Results);
- var resultList = await result.Results.ToListAsync();
+ Assert.NotNull(results);
+ var resultList = await results.ToListAsync();
Assert.NotNull(resultList);
Assert.Equal(10, resultList.Count);
foreach (var stringResult in resultList)
@@ -74,12 +73,11 @@ public async Task GetTextSearchResultsReturnsSuccessfullyAsync()
var textSearch = new BraveTextSearch(apiKey: "ApiKey", options: new() { HttpClient = this._httpClient });
// Act
- KernelSearchResults result = await textSearch.GetTextSearchResultsAsync("What is the Semantic Kernel?", new() { Top = 10, Skip = 0 });
+ var results = textSearch.GetTextSearchResultsAsync("What is the Semantic Kernel?", top: 10, new() { Skip = 0 });
// Assert
- Assert.NotNull(result);
- Assert.NotNull(result.Results);
- var resultList = await result.Results.ToListAsync();
+ Assert.NotNull(results);
+ var resultList = await results.ToListAsync();
Assert.NotNull(resultList);
Assert.Equal(10, resultList.Count);
foreach (var textSearchResult in resultList)
@@ -100,12 +98,11 @@ public async Task GetSearchResultsReturnsSuccessfullyAsync()
var textSearch = new BraveTextSearch(apiKey: "ApiKey", options: new() { HttpClient = this._httpClient });
// Act
- KernelSearchResults