a62633974f
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled
56 lines
1.2 KiB
C#
56 lines
1.2 KiB
C#
using Speckle.Automate.Sdk;
|
|
using Speckle.Automate.Sdk.Test;
|
|
using Speckle.Core.Api;
|
|
using Speckle.Core.Credentials;
|
|
|
|
namespace TestAutomateFunction;
|
|
|
|
[TestFixture]
|
|
public sealed class AutomationContextTest : IDisposable
|
|
{
|
|
private Client client;
|
|
private Account account;
|
|
|
|
[OneTimeSetUp]
|
|
public void Setup()
|
|
{
|
|
account = new Account
|
|
{
|
|
token = TestAutomateEnvironment.GetSpeckleToken(),
|
|
serverInfo = new ServerInfo
|
|
{
|
|
url = TestAutomateEnvironment.GetSpeckleServerUrl().ToString(),
|
|
},
|
|
};
|
|
client = new Client(account);
|
|
}
|
|
|
|
[Test]
|
|
public async Task TestFunctionRun()
|
|
{
|
|
var inputs = new FunctionInputs
|
|
{
|
|
ClimateZone = ClimateZone.Csa_MediterraneanHotSummer.ToString(),
|
|
CheckWindows = true,
|
|
CheckWalls = true,
|
|
CheckRoofs = true,
|
|
};
|
|
|
|
var automationRunData = await TestAutomateUtils.CreateTestRun(client);
|
|
var automationContext = await AutomationRunner.RunFunction(
|
|
AutomateFunction.Run,
|
|
automationRunData,
|
|
account.token,
|
|
inputs
|
|
);
|
|
|
|
Assert.That(automationContext.RunStatus, Is.EqualTo("SUCCEEDED"));
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
client.Dispose();
|
|
TestAutomateEnvironment.Clear();
|
|
}
|
|
}
|