FactSkipIfCI.cs (946B)
1 // ----------------------------------------------------------------------------- 2 // <copyright file="FactSkipIfCI.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 fact tests if running in CI builds. 14 /// </summary> 15 public class FactSkipIfCI : FactAttribute 16 { 17 /// <summary> 18 /// Initializes a new instance of the <see cref="FactSkipIfCI"/> class. 19 /// </summary> 20 public FactSkipIfCI() 21 { 22 if (Environment.GetEnvironmentVariable("BUILD_BUILDNUMBER") is not null) 23 { 24 this.Skip = "Skip test for CI builds"; 25 } 26 } 27 } 28 }