ImageTests.cs
1 // Copyright (c) Microsoft Corporation 2 // The Microsoft Corporation licenses this file to you under the MIT license. 3 // See the LICENSE file in the project root for more information. 4 5 using System; 6 using System.Linq; 7 using System.Reflection; 8 using Microsoft.CmdPal.Ext.System.Helpers; 9 using Microsoft.CmdPal.Ext.System.Pages; 10 using Microsoft.CommandPalette.Extensions; 11 using Microsoft.CommandPalette.Extensions.Toolkit; 12 using Microsoft.VisualStudio.TestTools.UnitTesting; 13 14 namespace Microsoft.CmdPal.Ext.System.UnitTests; 15 16 [TestClass] 17 public class ImageTests 18 { 19 [DataRow(true)] 20 [DataRow(false)] 21 [TestMethod] 22 public void IconThemeTest(bool isDarkIcon) 23 { 24 var systemPage = new SystemCommandPage(new Settings()); 25 var commands = systemPage.GetItems(); 26 27 foreach (var item in commands) 28 { 29 var icon = item.Icon; 30 Assert.IsNotNull(icon, $"Icon for '{item.Title}' should not be null."); 31 if (isDarkIcon) 32 { 33 Assert.IsNotEmpty(icon.Dark.Icon, $"Icon for '{item.Title}' should not be empty."); 34 } 35 else 36 { 37 Assert.IsNotEmpty(icon.Light.Icon, $"Icon for '{item.Title}' should not be empty."); 38 } 39 } 40 } 41 }