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