TheorySkipIfCI.cs (964B)
1 // ----------------------------------------------------------------------------- 2 // <copyright file="TheorySkipIfCI.cs" company="Microsoft Corporation"> 3 // Copyright (c) Microsoft Corporation. Licensed under the MIT License. 4 // </copyright> 5 // ----------------------------------------------------------------------------- 6 7 namespace Microsoft.Management.Configuration.UnitTests.Helpers 8 { 9 using System; 10 using Xunit; 11 12 /// <summary> 13 /// Skip theory test if running in CI builds. 14 /// </summary> 15 public sealed class TheorySkipIfCI : TheoryAttribute 16 { 17 /// <summary> 18 /// Initializes a new instance of the <see cref="TheorySkipIfCI"/> class. 19 /// </summary> 20 public TheorySkipIfCI() 21 { 22 if (Environment.GetEnvironmentVariable("BUILD_BUILDNUMBER") is not null) 23 { 24 this.Skip = "Skip test for CI builds"; 25 } 26 } 27 } 28 }