Exemple #1
0
        public static void IndexPrograms()
        {
            Win32[]           w = { };
            UWP.Application[] u = { };
            var t1 = Task.Run(() =>
            {
                w = Win32.All(_settings);
            });
            var t2 = Task.Run(() =>
            {
                var windows10 = new Version(10, 0);
                var support   = Environment.OSVersion.Version.Major >= windows10.Major;
                if (support)
                {
                    u = UWP.All();
                }
                else
                {
                    u = new UWP.Application[] { };
                }
            });

            Task.WaitAll(t1, t2);

            lock (IndexLock)
            {
                _win32s = w;
                _uwps   = u;
            }
        }
Exemple #2
0
        public void WhenGivenPriReferenceValueShouldReturnCorrectFormat(string packageName, string rawPriReferenceValue, string expectedFormat)
        {
            // Arrange
            var app = new UWP.Application();

            // Act
            var result = app.FormattedPriReferenceValue(packageName, rawPriReferenceValue);

            // Assert
            Assert.IsTrue(result == expectedFormat,
                          $"Expected Pri reference format: {expectedFormat}{Environment.NewLine} " +
                          $"Actual: {result}{Environment.NewLine}");
        }