38 lines
No EOL
1,019 B
C#
38 lines
No EOL
1,019 B
C#
using Autofac;
|
|
using Insight.Database;
|
|
using PlanTempus.Components;
|
|
using PlanTempus.Components.Users.Create;
|
|
using PlanTempus.Core.CommandQueries;
|
|
using PlanTempus.Core.Database;
|
|
using PlanTempus.Core.Database.ConnectionFactory;
|
|
using Shouldly;
|
|
|
|
namespace PlanTempus.X.TDD.CommandQueryHandlerTests;
|
|
|
|
[TestClass]
|
|
public class HandlerTest : TestFixture
|
|
{
|
|
[TestInitialize]
|
|
public void This()
|
|
{
|
|
}
|
|
|
|
[TestMethod]
|
|
public async Task ShouldResolveCommandHandlerAndDispatchToGenericCommandHandler()
|
|
{
|
|
var commandHandler = Container.Resolve<ICommandHandler>();
|
|
commandHandler.ShouldBeOfType<CommandHandler>();
|
|
|
|
var command = new CreateUserCommand
|
|
{
|
|
Email = "lloyd@dumbanddumber.com3", // Lloyd Christmas
|
|
Password = "1234AceVentura#LOL", // Ace Ventura
|
|
IsActive = true,
|
|
CorrelationId = Guid.NewGuid()
|
|
};
|
|
|
|
var result = await commandHandler.Handle(command);
|
|
|
|
result.ShouldNotBeNull();
|
|
}
|
|
} |