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,41 @@
using Hutopy.Application.TodoItems.Commands.CreateTodoItem;
using Hutopy.Application.TodoItems.Commands.DeleteTodoItem;
using Hutopy.Application.TodoLists.Commands.CreateTodoList;
using Hutopy.Domain.Entities;
namespace Hutopy.Application.FunctionalTests.TodoItems.Commands;
using static Testing;
public class DeleteTodoItemTests : BaseTestFixture
{
[Test]
public async Task ShouldRequireValidTodoItemId()
{
var command = new DeleteTodoItemCommand(99);
await FluentActions.Invoking(() =>
SendAsync(command)).Should().ThrowAsync<NotFoundException>();
}
[Test]
public async Task ShouldDeleteTodoItem()
{
var listId = await SendAsync(new CreateTodoListCommand
{
Title = "New List"
});
var itemId = await SendAsync(new CreateTodoItemCommand
{
ListId = listId,
Title = "New Item"
});
await SendAsync(new DeleteTodoItemCommand(itemId));
var item = await FindAsync<TodoItem>(itemId);
item.Should().BeNull();
}
}