| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using System; |
| | 5 | |
|
| | 6 | | namespace Azure.Core.TestFramework |
| | 7 | | { |
| | 8 | | public static class RecordedTestUtilities |
| | 9 | | { |
| | 10 | | private const string ModeEnvironmentVariableName = "AZURE_TEST_MODE"; |
| | 11 | |
|
| | 12 | | public static RecordedTestMode GetModeFromEnvironment() |
| | 13 | | { |
| 1702 | 14 | | string modeString = Environment.GetEnvironmentVariable(ModeEnvironmentVariableName); |
| | 15 | |
|
| 1702 | 16 | | RecordedTestMode mode = RecordedTestMode.Playback; |
| 1702 | 17 | | if (!string.IsNullOrEmpty(modeString)) |
| | 18 | | { |
| 0 | 19 | | mode = (RecordedTestMode)Enum.Parse(typeof(RecordedTestMode), modeString, true); |
| | 20 | | } |
| | 21 | |
|
| 1702 | 22 | | return mode; |
| | 23 | | } |
| | 24 | |
|
| | 25 | | } |
| | 26 | | } |