From 690ab31644b6cb5e1e9ff518e2d22d9666ae3f0b Mon Sep 17 00:00:00 2001 From: LukeParkerDev <10430890+Hona@users.noreply.github.com> Date: Thu, 14 Mar 2024 22:41:08 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20Split=20into=20minimally=20passi?= =?UTF-8?q?ng=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Features/Todos/Models/TodoTests.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/VerticalSliceArchitectureTemplate.Unit.Tests/Features/Todos/Models/TodoTests.cs b/tests/VerticalSliceArchitectureTemplate.Unit.Tests/Features/Todos/Models/TodoTests.cs index 132bddc..aeca4e9 100644 --- a/tests/VerticalSliceArchitectureTemplate.Unit.Tests/Features/Todos/Models/TodoTests.cs +++ b/tests/VerticalSliceArchitectureTemplate.Unit.Tests/Features/Todos/Models/TodoTests.cs @@ -7,7 +7,7 @@ namespace VerticalSliceArchitectureTemplate.Unit.Tests.Features.Todos.Models; public class TodoTests { [Fact] - public void Todo_Complete_ShouldUpdateCompletedAndAddEvent() + public void Todo_Complete_ShouldUpdateCompleted() { // Arrange var item = new Todo @@ -21,6 +21,22 @@ public void Todo_Complete_ShouldUpdateCompletedAndAddEvent() // Assert item.Completed.Should().BeTrue(); + } + + [Fact] + public void Todo_Complete_ShouldAddEvent() + { + // Arrange + var item = new Todo + { + Id = Guid.NewGuid(), + Text = "My todo item" + }; + + // Act + item.Complete(); + + // Assert item.StagedEvents.Should().ContainSingle(x => x is TodoCompletedEvent, "because the item was completed"); } } \ No newline at end of file