-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathTestTerraEnvInfo.cs
51 lines (43 loc) · 1.88 KB
/
TestTerraEnvInfo.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TesApi.Tests.Integration
{
internal class TestTerraEnvInfo
{
private const string LzStorageAccountNameEnvVarName = "TERRA_LZ_STORAGE_ACCOUNT";
private const string WorkspaceContainerNameEnvVarName = "TERRA_WS_STORAGE_CONTAINER";
private const string WsmApiHostEnvVarName = "TERRA_WSM_API_HOST";
private readonly string lzStorageAccountName;
private readonly string workspaceContainerName;
private readonly string wsmApiHost;
public string LzStorageAccountName => lzStorageAccountName;
public string WorkspaceContainerName => workspaceContainerName;
public string WsmApiHost => wsmApiHost;
public TestTerraEnvInfo()
{
lzStorageAccountName = Environment.GetEnvironmentVariable(LzStorageAccountNameEnvVarName);
workspaceContainerName = Environment.GetEnvironmentVariable(WorkspaceContainerNameEnvVarName);
wsmApiHost = Environment.GetEnvironmentVariable(WsmApiHostEnvVarName);
if (string.IsNullOrEmpty(lzStorageAccountName))
{
throw new InvalidOperationException(
$"The environment variable {LzStorageAccountNameEnvVarName} is not set");
}
if (string.IsNullOrEmpty(workspaceContainerName))
{
throw new InvalidOperationException(
$"The environment variable {WorkspaceContainerNameEnvVarName} is not set");
}
if (string.IsNullOrEmpty(wsmApiHost))
{
throw new InvalidOperationException(
$"The environment variable {WsmApiHostEnvVarName} is not set");
}
}
}
}