From b3a0d6796289b80cab641a1942742b19e0de8d6f Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Tue, 30 Dec 2014 07:12:52 +0100 Subject: [PATCH] Added test for recent failure with better error message --- Logic/Support/SingularFactory.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Logic/Support/SingularFactory.cs b/Logic/Support/SingularFactory.cs index cfe66552..1b70bb6e 100644 --- a/Logic/Support/SingularFactory.cs +++ b/Logic/Support/SingularFactory.cs @@ -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; }