Skip to content

Instantly share code, notes, and snippets.

@afawcett afawcett/gist:6791111
Last active Dec 24, 2015

Embed
What would you like to do?
public with sharing class AssertCallback {
private static Map<Type, IAssertCallback> callbacks = new Map<Type, IAssertCallback>();
public interface IAssertCallback
{
void assert(String location, Object state);
}
public static void assert(Type stateType, String location, Object state)
{
if(!Test.isRunningTest())
return;
if(callbacks.containsKey(stateType))
callbacks.get(stateType).assert(location, state);
}
public static void registerCallback(Type stateClass, IAssertCallback assertCallback)
{
callbacks.put(stateClass, assertCallback);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.