public static void Initialize() { var commandClasses = ReflectiveEnumerator.GetInheritedFromInterface <ICommand>(); foreach (var commandClass in commandClasses) { var commandAttribute = commandClass.GetType().GetCustomAttributes(typeof(Command), false).FirstOrDefault() as Command; if (commandAttribute == null) { continue; } Get.Add(commandAttribute.CommandText, commandClass); } }
public void GetImplementationsOfInterfaces() { var implementations = ReflectiveEnumerator.GetInheritedFromInterface <ICommand>(); Assert.True(implementations.Count > 0); }