Last active
October 23, 2015 21:58
-
-
Save sdanna/99586bcc7c07852698d6 to your computer and use it in GitHub Desktop.
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
using System.Linq; | |
using IntegrationTests.Fixtures; | |
using Xunit; | |
using Zomg.Features.Company; | |
namespace IntegrationTests.Features.Company | |
{ | |
public class CreateHandlerTests | |
{ | |
[Collection("IntegrationTests.Features.Company.CreateHandlerTests")] | |
public class TheHandleMethod : IClassFixture<DbFixture<CreateHandlerTests>> | |
{ | |
private readonly DbFixture<CreateHandlerTests> _dbFixture; | |
private Create.Command _handledCommand; | |
private Create.CommandHandler _handler; | |
public TheHandleMethod(IntegrationTestFixture<CreateHandlerTests> dbFixture) | |
{ | |
_handledCommand = new Create.Command | |
{ | |
CompanyName = "HandledCompany", | |
Email = "[email protected]" | |
}; | |
} | |
[Fact] | |
public void ShouldCreateCompany() | |
{ | |
_handler.Handle(_handledCommand); | |
int count = _dbFixture.Context.Companies.Count(x => x.Name == _handledCommand.CompanyName); | |
Assert.Equal(1, count); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment