33 lines
866 B
C#
33 lines
866 B
C#
using Hutopy.Application.TodoLists.Commands.CreateTodoList;
|
|
using Hutopy.Application.TodoLists.Commands.DeleteTodoList;
|
|
using Hutopy.Domain.Entities;
|
|
|
|
namespace Hutopy.Application.FunctionalTests.TodoLists.Commands;
|
|
|
|
using static Testing;
|
|
|
|
public class DeleteTodoListTests : BaseTestFixture
|
|
{
|
|
[Test]
|
|
public async Task ShouldRequireValidTodoListId()
|
|
{
|
|
var command = new DeleteTodoListCommand(99);
|
|
await FluentActions.Invoking(() => SendAsync(command)).Should().ThrowAsync<NotFoundException>();
|
|
}
|
|
|
|
[Test]
|
|
public async Task ShouldDeleteTodoList()
|
|
{
|
|
var listId = await SendAsync(new CreateTodoListCommand
|
|
{
|
|
Title = "New List"
|
|
});
|
|
|
|
await SendAsync(new DeleteTodoListCommand(listId));
|
|
|
|
var list = await FindAsync<TodoList>(listId);
|
|
|
|
list.Should().BeNull();
|
|
}
|
|
}
|