Created
March 23, 2011 19:55
-
-
Save wickedshimmy/883821 to your computer and use it in GitHub Desktop.
I think Moq rocks. But it's this far from being perfect:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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