Skip to content

Instantly share code, notes, and snippets.

@andlju
Created June 26, 2011 19:47
Show Gist options
  • Save andlju/1047909 to your computer and use it in GitHub Desktop.
Save andlju/1047909 to your computer and use it in GitHub Desktop.
Sample test from coming Entile drop.
public class When_Updating_Registration_On_Registered_Client : With<Client>
{
protected override IEnumerable<IEvent> Given()
{
yield return new ClientRegisteredEvent("1234", "http://my.channel.com");
}
protected override void When(Client client)
{
client.UpdateRegistration("http://new.channel.com");
}
[Fact]
public void Then_ClientRegistrationUpdatedEvent_Is_Sent()
{
AssertEvent.IsType<ClientRegistrationUpdatedEvent>(0);
}
[Fact]
public void Then_The_UniqueId_On_The_Event_Is_Correct()
{
AssertEvent.Contents<ClientRegistrationUpdatedEvent>(0,
ev => Assert.Equal("1234", ev.UniqueId));
}
[Fact]
public void Then_The_NotificationChannel_On_The_Event_Is_Correct()
{
AssertEvent.Contents<ClientRegistrationUpdatedEvent>(0,
ev => Assert.Equal("http://new.channel.com", ev.NotificationChannel));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment