forked from microsoft/winget-cli
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
335 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// ----------------------------------------------------------------------------- | ||
// <copyright file="FontCommand.cs" company="Microsoft Corporation"> | ||
// Copyright (c) Microsoft Corporation. Licensed under the MIT License. | ||
// </copyright> | ||
// ----------------------------------------------------------------------------- | ||
|
||
namespace AppInstallerCLIE2ETests | ||
{ | ||
using AppInstallerCLIE2ETests.Helpers; | ||
using NUnit.Framework; | ||
|
||
/// <summary> | ||
/// Test font command. | ||
/// </summary> | ||
public class FontCommand : BaseCommand | ||
{ | ||
/// <summary> | ||
/// One time set up. | ||
/// </summary> | ||
[SetUp] | ||
public void OneTimeSetup() | ||
{ | ||
WinGetSettingsHelper.ConfigureFeature("fonts", true); | ||
} | ||
|
||
/// <summary> | ||
/// Test install a font with user scope. | ||
/// </summary> | ||
[Test] | ||
public void InstallFont() | ||
{ | ||
var result = TestCommon.RunAICLICommand("font install", $"-m {TestCommon.GetTestDataFile(@"Manifests\TestFont.yaml")}"); | ||
Assert.AreEqual(Constants.ErrorCode.S_OK, result.ExitCode); | ||
Assert.True(result.StdOut.Contains("Successfully installed")); | ||
TestCommon.VerifyFontPackage(Constants.TestFontSubKeyName, Constants.FontFileName); | ||
} | ||
|
||
/// <summary> | ||
/// Test install a font with machine scope. | ||
/// </summary> | ||
[Test] | ||
public void InstallFont_MachineScope() | ||
{ | ||
var result = TestCommon.RunAICLICommand("font install", $"-m {TestCommon.GetTestDataFile(@"Manifests\TestFont.yaml")} --scope Machine"); | ||
Assert.AreEqual(Constants.ErrorCode.S_OK, result.ExitCode); | ||
Assert.True(result.StdOut.Contains("Successfully installed")); | ||
TestCommon.VerifyFontPackage(Constants.TestFontSubKeyName, Constants.FontFileName, TestCommon.Scope.Machine); | ||
} | ||
|
||
/// <summary> | ||
/// Test install an invalid font file. | ||
/// </summary> | ||
[Test] | ||
public void InstallInvalidFont() | ||
{ | ||
var result = TestCommon.RunAICLICommand("font install", $"-m {TestCommon.GetTestDataFile(@"Manifests\TestInvalidFont.yaml")} --scope Machine"); | ||
Assert.AreEqual(Constants.ErrorCode.ERROR_FONT_FILE_NOT_SUPPORTED, result.ExitCode); | ||
Assert.True(result.StdOut.Contains("The font file is not supported and cannot be installed.")); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.