FeaturesCommand.cs (2001B)
1 // ----------------------------------------------------------------------------- 2 // <copyright file="FeaturesCommand.cs" company="Microsoft Corporation"> 3 // Copyright (c) Microsoft Corporation. Licensed under the MIT License. 4 // </copyright> 5 // ----------------------------------------------------------------------------- 6 7 namespace AppInstallerCLIE2ETests 8 { 9 using AppInstallerCLIE2ETests.Helpers; 10 using NUnit.Framework; 11 12 /// <summary> 13 /// Features command tests. 14 /// </summary> 15 public class FeaturesCommand : BaseCommand 16 { 17 /// <summary> 18 /// Set up. 19 /// </summary> 20 [SetUp] 21 public void Setup() 22 { 23 WinGetSettingsHelper.InitializeAllFeatures(false); 24 } 25 26 /// <summary> 27 /// Tear down. 28 /// </summary> 29 [TearDown] 30 public void TearDown() 31 { 32 WinGetSettingsHelper.InitializeAllFeatures(false); 33 } 34 35 /// <summary> 36 /// Tests winget features. 37 /// </summary> 38 [Test] 39 public void DisplayFeatures() 40 { 41 var result = TestCommon.RunAICLICommand("features", string.Empty); 42 Assert.AreEqual(Constants.ErrorCode.S_OK, result.ExitCode); 43 Assert.True(result.StdOut.Contains("Direct MSI Installation")); 44 } 45 46 /// <summary> 47 /// Tests enabled winget features. 48 /// </summary> 49 [Test] 50 public void EnableExperimentalFeatures() 51 { 52 WinGetSettingsHelper.ConfigureFeature("experimentalArg", true); 53 WinGetSettingsHelper.ConfigureFeature("experimentalCmd", true); 54 WinGetSettingsHelper.ConfigureFeature("directMSI", true); 55 WinGetSettingsHelper.ConfigureFeature("resume", true); 56 var result = TestCommon.RunAICLICommand("features", string.Empty); 57 Assert.True(result.StdOut.Contains("Enabled")); 58 } 59 } 60 }