Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ protected override void IntegrationSetup(IElasticClient client, CallUniqueValues
PutFilter(client, callUniqueValue.Value);
}

protected override void IntegrationTeardown(IElasticClient client, CallUniqueValues values)
{
foreach (var callUniqueValue in values)
DeleteFilter(client, callUniqueValue.Value);
}

protected override bool ExpectIsValid => true;

protected override object ExpectJson => null;
Expand Down Expand Up @@ -71,6 +77,13 @@ protected override void IntegrationSetup(IElasticClient client, CallUniqueValues
PutFilter(client, callUniqueValue.Value + "_" + (i + 1));
}

protected override void IntegrationTeardown(IElasticClient client, CallUniqueValues values)
{
foreach (var callUniqueValue in values)
for (var i = 0; i < 3; i++)
DeleteFilter(client, callUniqueValue.Value + "_" + (i + 1));
}

protected override bool ExpectIsValid => true;

protected override object ExpectJson => null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ protected PutFilterResponse PutFilter(IElasticClient client, string filterId)
return putFilterResponse;
}

protected DeleteFilterResponse DeleteFilter(IElasticClient client, string filterId)
{
var deleteFilterResponse = client.MachineLearning.DeleteFilter(filterId);

if (!deleteFilterResponse.IsValid)
throw new Exception($"Problem deleting filter {filterId} for integration test: {deleteFilterResponse.DebugInformation}");

return deleteFilterResponse;
}

protected PutCalendarResponse PutCalendar(IElasticClient client, string calendarId)
{
var putCalendarResponse = client.MachineLearning.PutCalendar(calendarId, f => f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ public class PutFilterApiTests : MachineLearningIntegrationTestBase<PutFilterRes
{
public PutFilterApiTests(MachineLearningCluster cluster, EndpointUsage usage) : base(cluster, usage) { }

protected override void IntegrationTeardown(IElasticClient client, CallUniqueValues values)
{
foreach (var callUniqueValue in values)
DeleteFilter(client, callUniqueValue.Value);
}

protected override bool ExpectIsValid => true;

protected override object ExpectJson => new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ protected override void IntegrationSetup(IElasticClient client, CallUniqueValues
PutFilter(client, callUniqueValue.Value);
}

protected override void IntegrationTeardown(IElasticClient client, CallUniqueValues values)
{
foreach (var callUniqueValue in values)
DeleteFilter(client, callUniqueValue.Value);
}

protected override bool ExpectIsValid => true;

protected override object ExpectJson => new
Expand Down