Created
June 26, 2011 19:47
-
-
Save andlju/1047909 to your computer and use it in GitHub Desktop.
Sample test from coming Entile drop.
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
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