Skip to content

Instantly share code, notes, and snippets.

@joebuschmann
Last active August 29, 2015 14:07
Show Gist options
  • Save joebuschmann/0efa93da64b19e6c2576 to your computer and use it in GitHub Desktop.
Save joebuschmann/0efa93da64b19e6c2576 to your computer and use it in GitHub Desktop.
Specflow CompareToInstance<T>() with generic parameter
public static void CompareToInstance<T>(this Table table, T instance)
{
AssertThatTheInstanceExists(instance);
var instanceTable = TEHelpers.GetTheProperInstanceTable(table, typeof(T));
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