< Summary

Class:Azure.Core.TestFramework.RecordedTestUtilities
Assembly:Azure.Core.TestFramework
File(s):C:\Git\azure-sdk-for-net\sdk\core\Azure.Core.TestFramework\src\RecordedTestUtilities.cs
Covered lines:4
Uncovered lines:1
Coverable lines:5
Total lines:26
Line coverage:80% (4 of 5)
Covered branches:1
Total branches:2
Branch coverage:50% (1 of 2)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
GetModeFromEnvironment()-80%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\core\Azure.Core.TestFramework\src\RecordedTestUtilities.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5
 6namespace 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        {
 170214            string modeString = Environment.GetEnvironmentVariable(ModeEnvironmentVariableName);
 15
 170216            RecordedTestMode mode = RecordedTestMode.Playback;
 170217            if (!string.IsNullOrEmpty(modeString))
 18            {
 019                mode = (RecordedTestMode)Enum.Parse(typeof(RecordedTestMode), modeString, true);
 20            }
 21
 170222            return mode;
 23        }
 24
 25    }
 26}

Methods/Properties

GetModeFromEnvironment()