Created
January 21, 2016 02:35
-
-
Save vkhorikov/17cbb7030b40c4d843c3 to your computer and use it in GitHub Desktop.
Arrange Section reuse example
This file contains hidden or 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 UserTests | |
{ | |
[Fact] | |
public void Should_fire_event_after_provisioning() | |
{ | |
// Arrange | |
Organization organization = CreateOrganization(); | |
User user = CreateUser(organization); | |
Subscription subscription = CreateSubscription(Package.Streamer, organization); | |
// Act | |
organization.ProvisionUser(user, subscription); | |
// Assert | |
user.ShouldContainSingleEvent<SeatCreatedEvent>(); | |
} | |
[Fact] | |
public void Should_fire_event_after_updating_first_name() | |
{ | |
// Arrange | |
Organization organization = CreateOrganization(); | |
User user = CreateUser(organization); | |
FirstName newFirstName = (FirstName)Guid.NewGuid().ToString(); | |
// Act | |
user.SetFirstName(newFirstName); | |
// Assert | |
user.FirstName.Value.Should().Be(newFirstName); | |
user.ShouldContainSingleEvent<UserUpdatedEvent>(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment