Skip to content

Instantly share code, notes, and snippets.

@joebuschmann
Created October 5, 2014 20:39
Show Gist options
  • Save joebuschmann/16035ad4645574c39519 to your computer and use it in GitHub Desktop.
Save joebuschmann/16035ad4645574c39519 to your computer and use it in GitHub Desktop.
Specflow CompareToInstance<T>() without generic parameter
public static void CompareToInstance(this Table table, object instance)
{
AssertThatTheInstanceExists(instance);
var instanceTable = TEHelpers.GetTheProperInstanceTable(table, instance.GetType());
var differences = FindAnyDifferences(instanceTable, instance);
if (ThereAreAnyDifferences(differences))
ThrowAnExceptionThatDescribesThoseDifferences(differences);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment