PlanTempusApp/Tests/CommandQueryHandlerTests/HandlerTest.cs
Janus C. H. Knudsen a991dcdb97 Updates configuration and refactors code structure
Migrates connection strings to new database host
Removes unnecessary code and improves configuration handling
Enhances test coverage and adds random word generation
Updates telemetry and command handling patterns
2026-01-08 21:51:43 +01:00

37 lines
No EOL
1 KiB
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 = $"{GetRandomWord()}@dumbanddumber.com5", // Lloyd Christmas
Password = "1234AceVentura#LOL", // Ace Ventura
IsActive = true,
CorrelationId = Guid.NewGuid()
};
var result = await commandHandler.Handle(command);
result.ShouldNotBeNull();
}
}