First commit. Include junk from template to remove

This commit is contained in:
Dominic Villemure
2024-03-09 20:25:30 -05:00
commit bbcefcf76f
140 changed files with 8151 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
using Hutopy.Application.Common.Exceptions;
using Hutopy.Application.TodoLists.Commands.CreateTodoList;
using Hutopy.Domain.Entities;
namespace Hutopy.Application.FunctionalTests.TodoLists.Commands;
using static Testing;
public class CreateTodoListTests : BaseTestFixture
{
[Test]
public async Task ShouldRequireMinimumFields()
{
var command = new CreateTodoListCommand();
await FluentActions.Invoking(() => SendAsync(command)).Should().ThrowAsync<ValidationException>();
}
[Test]
public async Task ShouldRequireUniqueTitle()
{
await SendAsync(new CreateTodoListCommand
{
Title = "Shopping"
});
var command = new CreateTodoListCommand
{
Title = "Shopping"
};
await FluentActions.Invoking(() =>
SendAsync(command)).Should().ThrowAsync<ValidationException>();
}
[Test]
public async Task ShouldCreateTodoList()
{
var userId = await RunAsDefaultUserAsync();
var command = new CreateTodoListCommand
{
Title = "Tasks"
};
var id = await SendAsync(command);
var list = await FindAsync<TodoList>(id);
list.Should().NotBeNull();
list!.Title.Should().Be(command.Title);
list.CreatedBy.Should().Be(userId);
list.Created.Should().BeCloseTo(DateTime.Now, TimeSpan.FromMilliseconds(10000));
}
}