Skip to content

Instantly share code, notes, and snippets.

@FilipDeVos
Created March 3, 2014 21:19
Show Gist options
  • Save FilipDeVos/9334836 to your computer and use it in GitHub Desktop.
Save FilipDeVos/9334836 to your computer and use it in GitHub Desktop.
this breaks Resharper
// install-package fakeiteasy
// install-package shortbus.markers -pre
// install-package shortbus -pre
using FakeItEasy;
using ShortBus;
public class MyItem
{
public string Name { get; set; }
}
public class MyItemQuery : ShortBus.IRequest<MyItem>
{
public string Author { get; set; }
}
public class MyItemQueryHandler : ShortBus.IRequestHandler<MyItemQuery, MyItem>
{
public MyItem Handle(MyItemQuery query)
{
return new MyItem { Name = "Me" };
}
}
public class Program
{
public static void Main()
{
var mediator = A.Fake<Mediator>();
A.CallTo(() => mediator.Request<MyItem>(A<MyItemQuery>._).Data)
.Returns(new MyItem());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment