First commit. Include junk from template to remove
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user