Skip to content

Instantly share code, notes, and snippets.

@hurricanepkt
Created October 6, 2011 17:39
Show Gist options
  • Save hurricanepkt/1268063 to your computer and use it in GitHub Desktop.
Save hurricanepkt/1268063 to your computer and use it in GitHub Desktop.
What pattern is this (mock spy ?? )
//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;
}
}
[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