test(e2e): add CliRunner helpers for data-connection, api-method, api-key teardown, instance read-back
This commit is contained in:
+41
@@ -43,4 +43,45 @@ public class CliRunnerHelpersTests
|
||||
Skip.IfNot(await ClusterAvailability.IsAvailableAsync(), ClusterAvailability.SkipReason);
|
||||
Assert.True(await CliRunner.ResolveSiteIdAsync("site-a") > 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A freshly created data connection returns a positive id and is cleanly
|
||||
/// deleted in teardown, exercising <see cref="CliRunner.CreateDataConnectionAsync"/>
|
||||
/// and <see cref="CliRunner.DeleteDataConnectionAsync"/> as a round-trip.
|
||||
/// </summary>
|
||||
[SkippableFact]
|
||||
public async Task CreateThenDeleteDataConnection_RoundTrips()
|
||||
{
|
||||
Skip.IfNot(await ClusterAvailability.IsAvailableAsync(), ClusterAvailability.SkipReason);
|
||||
var siteId = await CliRunner.ResolveSiteIdAsync("site-a");
|
||||
var id = await CliRunner.CreateDataConnectionAsync(siteId, CliRunner.UniqueName("conn"));
|
||||
try
|
||||
{
|
||||
Assert.True(id > 0);
|
||||
}
|
||||
finally
|
||||
{
|
||||
await CliRunner.DeleteDataConnectionAsync(id);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A freshly created API method returns a positive id and is cleanly deleted in
|
||||
/// teardown, exercising <see cref="CliRunner.CreateApiMethodAsync"/> and
|
||||
/// <see cref="CliRunner.DeleteApiMethodAsync"/> as a round-trip.
|
||||
/// </summary>
|
||||
[SkippableFact]
|
||||
public async Task CreateThenDeleteApiMethod_RoundTrips()
|
||||
{
|
||||
Skip.IfNot(await ClusterAvailability.IsAvailableAsync(), ClusterAvailability.SkipReason);
|
||||
var id = await CliRunner.CreateApiMethodAsync(CliRunner.UniqueName("method"));
|
||||
try
|
||||
{
|
||||
Assert.True(id > 0);
|
||||
}
|
||||
finally
|
||||
{
|
||||
await CliRunner.DeleteApiMethodAsync(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user