Flow.Launcher/Flow.Launcher.Test/Plugins/ProgramTest.cs

31 lines
1.5 KiB
C#
Raw Permalink Normal View History

2020-04-26 10:30:18 +00:00
using Flow.Launcher.Plugin.Program.Programs;
using NUnit.Framework;
using System;
using Windows.ApplicationModel;
namespace Flow.Launcher.Test.Plugins
{
[TestFixture]
public class ProgramTest
{
[TestCase("Microsoft.WindowsCamera", "ms-resource:LensSDK/Resources/AppTitle", "ms-resource://Microsoft.WindowsCamera/LensSDK/Resources/AppTitle")]
[TestCase("microsoft.windowscommunicationsapps", "ms-resource://microsoft.windowscommunicationsapps/hxoutlookintl/AppManifest_MailDesktop_DisplayName",
"ms-resource://microsoft.windowscommunicationsapps/hxoutlookintl/AppManifest_MailDesktop_DisplayName")]
[TestCase("windows.immersivecontrolpanel", "ms-resource:DisplayName", "ms-resource://windows.immersivecontrolpanel/Resources/DisplayName")]
[TestCase("Microsoft.MSPaint", "ms-resource:AppName", "ms-resource://Microsoft.MSPaint/Resources/AppName")]
public void WhenGivenPriReferenceValueShouldReturnCorrectFormat(string packageName, string rawPriReferenceValue, string expectedFormat)
{
// Arrange
var app = new UWP.Application();
// Act
2022-10-21 10:39:03 +00:00
var result = UWP.Application.FormattedPriReferenceValue(packageName, rawPriReferenceValue);
2020-04-26 10:30:18 +00:00
// Assert
Assert.IsTrue(result == expectedFormat,
$"Expected Pri reference format: {expectedFormat}{Environment.NewLine} " +
$"Actual: {result}{Environment.NewLine}");
}
}
}