/ src / modules / launcher / Plugins / Microsoft.Plugin.Folder.UnitTests / EnvironmentHelperTests.cs
EnvironmentHelperTests.cs
 1  // Copyright (c) Microsoft Corporation
 2  // The Microsoft Corporation licenses this file to you under the MIT license.
 3  // See the LICENSE file in the project root for more information.
 4  
 5  using Microsoft.Plugin.Folder.Sources;
 6  using Microsoft.VisualStudio.TestTools.UnitTesting;
 7  
 8  namespace Microsoft.Plugin.Folder.UnitTests
 9  {
10      [TestClass]
11      public class EnvironmentHelperTests
12      {
13          [DataTestMethod]
14          [DataRow(@"%", true)]
15          [DataRow(@"%P", true)]
16          [DataRow(@"%PROGRAMDATA%", true)]
17          [DataRow(@"", false)]
18          [DataRow(@"C:\ProgramData", false)]
19  
20          public void IsValidEnvironmentVariable(string search, bool expectedSuccess)
21          {
22              var helper = new EnvironmentHelper();
23  
24              var result = helper.IsEnvironmentVariable(search);
25  
26              Assert.AreEqual(expectedSuccess, result);
27          }
28      }
29  }