Files
ClassicAssist.Avalonia/ClassicAssist.Tests/HotkeyTests.cs
T
Beyhan Oğur d5f52cc3d3 first commit
2026-09-03 04:45:36 +03:00

31 lines
948 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using ClassicAssist.Shared;
using ClassicAssist.Data.Hotkeys.Commands;
using ClassicAssist.UI.Misc;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace ClassicAssist.Tests
{
[TestClass]
public class HotkeyTests
{
[TestMethod]
public void WillInstantiateAllHotkeysCommandsNoExceptions()
{
IEnumerable<Type> hotkeyCommands = Assembly.GetAssembly( typeof( Engine ) ).GetTypes()
.Where( i => i.IsSubclassOf( typeof( HotkeyCommand ) ) );
ObservableCollectionEx<HotkeyCommand> hotkeys = new ObservableCollectionEx<HotkeyCommand>();
foreach ( Type hotkeyCommand in hotkeyCommands )
{
HotkeyCommand hkc = (HotkeyCommand) Activator.CreateInstance( hotkeyCommand );
hotkeys.Add( hkc );
}
}
}
}