Skip to content

Instantly share code, notes, and snippets.

View phatboyg's full-sized avatar

Chris Patterson phatboyg

View GitHub Profile
@phatboyg
phatboyg / ActorSyntax.cs
Created November 10, 2010 16:00
Examinations on how actors should work
public class CustomerAccount :
Actor
{
string _name;
public void Handle(Message<UpdateName> msg)
{
_name = msg.Name;
}
}
public class SimpleExample
{
public void SomeMethod<T>(T arg)
{
DoSomethingWith(arg);
}
}
@phatboyg
phatboyg / .gitconfig
Created March 24, 2010 12:17
Git Config
[core]
autoCRLF = false
editor = c:/bin/git/npp.cmd
[diff]
tool = kd3
[merge]
tool = kd3
[difftool "kd3"]
cmd = c:/bin/git/kdiff3.cmd \"$LOCAL\" \"$REMOTE\"
[difftool]
internal class Program
{
private static void Main(string[] args)
{
RunConfiguration configuration = RunnerConfigurator.New(x =>
{
x.SetServiceName("CalebMailService");
x.SetDisplayName("Caleb's Mail Service");
x.SetDescription("Give you some sexy mail service");
// message sender coder
IServiceBus bus = ObjectFactory.GetInstance<IServiceBus>();
var message = new MyCommand { Text = "How's it going?" };
ObjectFactory.GetInstance<IEndpointFactory>().GetEndpoint("msmq://localhost/test_server").Send(message, x => x.SendResponseTo(bus));
/// - snip
ObjectFactory.Configure(x =>
{
x.AddRegistry(new ServerRegistry());
});
public class ServerRegistry : MassTransitRegistryBase {
public ServerRegistry()
{
RegisterControlBus("msmq://localhost/test_server_control", x => { });
[Test]
public void mock()
{
Func<int,int> mocked = MockRepository.GenerateMock<Func<int, int>>();
mocked.Expect(x => x(27)).Return(47);
int result = mocked(27);
mocked.VerifyAllExpectations();