Created
October 6, 2011 17:39
-
-
Save hurricanepkt/1268063 to your computer and use it in GitHub Desktop.
What pattern is this (mock spy ?? )
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
//DynamicModel is the main part of Massive | |
//https://github.com/robconery/massive | |
class SpyMassive : DynamicModel | |
{ | |
//Created an empty base constructor for massive to prevent exceptions | |
public SpyMassive() : base() | |
{ | |
} | |
///Edited for brevity | |
public dynamic SingleResult; | |
public override dynamic Single(string @where, params object[] args) | |
{ | |
return SingleResult; | |
} | |
} | |
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
[Test] | |
public void not_found_should_return_false() | |
{ | |
//MOCK Expected Result | |
_spyMassive.SingleResult = null; | |
var email = "test@test.com"; | |
Assert.IsNull(_spyMassive.Single(where: "email = @0", args: email)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment