Skip to content

Commit

Permalink
🧪 Split into minimally passing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Hona committed Mar 14, 2024
1 parent a8e718c commit 690ab31
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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");
}
}

0 comments on commit 690ab31

Please sign in to comment.