Added test for recent failure with better error message

This commit is contained in:
Rick Falkvinge
2014-12-30 07:12:52 +01:00
parent d949ae5543
commit b3a0d67962
+7
View File
@@ -53,6 +53,13 @@ namespace Swarmops.Logic.Support
Type logicType = logicTypes[0];
basicConverterMethod = logicType.GetMethod ("FromBasic", BindingFlags.Static | BindingFlags.Public);
if (basicConverterMethod == null)
{
throw new InvalidOperationException(
"Unable to find a public static method named \"" + logicType.ToString() + ".FromBasic (" +basicType.ToString()+ ")\" in the Swarmops.Logic assembly");
}
_converterLookup[basicType] = basicConverterMethod;
}