/// <summary>
        /// Modifies the <paramref name="test"/> by adding categories to it and changing the run state as needed.
        /// </summary>
        /// <param name="test">The <see cref="Test"/> to modify.</param>
        public void ApplyToTest(Test test)
        {
            test.Properties.Add("Category", "Live");

            if (test.RunState != RunState.NotRunnable)
            {
                RecordedTestMode mode = RecordedTestUtilities.GetModeFromEnvironment();
                if (mode != RecordedTestMode.Live)
                {
                    test.RunState = RunState.Ignored;
                    test.Properties.Set("_SKIPREASON", $"Live tests will not run when AZURE_TEST_MODE is {mode}");
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Modifies the <paramref name="test"/> by adding categories to it and changing the run state as needed.
        /// </summary>
        /// <param name="test">The <see cref="Test"/> to modify.</param>
        public void ApplyToTest(Test test)
        {
            test.Properties.Add("Category", "Playback");

            if (test.RunState != RunState.NotRunnable)
            {
                RecordedTestMode mode = RecordedTestUtilities.GetModeFromEnvironment();
                if (mode != RecordedTestMode.Playback)
                {
                    test.RunState = RunState.Ignored;
                    test.Properties.Set("_SKIPREASON", $"Playback tests will not run when AZURE_TEST_MODE is {mode}.  This test was skipped for the following reason: {_reason}");
                }
            }
        }
Ejemplo n.º 3
0
 protected RecordedTestBase(bool isAsync) : this(isAsync, RecordedTestUtilities.GetModeFromEnvironment())
 {
 }
        private static ParallelScope ApplyModeToParallelScope(ParallelScope scope)
        {
            RecordedTestMode mode = RecordedTestUtilities.GetModeFromEnvironment();

            return(mode == RecordedTestMode.Live ? scope : ParallelScope.None);
        }