Skip to content

Instantly share code, notes, and snippets.

@wickedshimmy
Created March 23, 2011 19:55
Show Gist options
  • Save wickedshimmy/883821 to your computer and use it in GitHub Desktop.
Save wickedshimmy/883821 to your computer and use it in GitHub Desktop.
I think Moq rocks. But it's this far from being perfect:
class Mock<T> : Moq.Mock<T> where T : class {
public static implicit operator T(Mock<T> mock)
{
return mock == null ? null : mock.Object;
}
}
class Dingus<T> : Mock<T> where T : class {
public Dingus ()
{
DefaultValue = Moq.DefaultValue.Mock;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment