/ src / modules / cmdpal / Tests / Microsoft.CmdPal.Ext.WebSearch.UnitTests / WebSearchCommandProviderTests.cs
WebSearchCommandProviderTests.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 Microsoft.VisualStudio.TestTools.UnitTesting; 6 7 namespace Microsoft.CmdPal.Ext.WebSearch.UnitTests; 8 9 [TestClass] 10 public class WebSearchCommandProviderTests 11 { 12 [TestMethod] 13 public void ProviderHasCorrectId() 14 { 15 // Setup 16 var provider = new WebSearchCommandsProvider(); 17 18 // Assert 19 Assert.AreEqual("com.microsoft.cmdpal.builtin.websearch", provider.Id); 20 } 21 22 [TestMethod] 23 public void ProviderHasDisplayName() 24 { 25 // Setup 26 var provider = new WebSearchCommandsProvider(); 27 28 // Assert 29 Assert.IsNotNull(provider.DisplayName); 30 Assert.IsTrue(provider.DisplayName.Length > 0); 31 } 32 33 [TestMethod] 34 public void ProviderHasIcon() 35 { 36 // Setup 37 var provider = new WebSearchCommandsProvider(); 38 39 // Assert 40 Assert.IsNotNull(provider.Icon); 41 } 42 43 [TestMethod] 44 public void TopLevelCommandsNotEmpty() 45 { 46 // Setup 47 var provider = new WebSearchCommandsProvider(); 48 49 // Act 50 var commands = provider.TopLevelCommands(); 51 52 // Assert 53 Assert.IsNotNull(commands); 54 Assert.IsTrue(commands.Length > 0); 55 } 56 }