Skip to content

Commit addd302

Browse files
committed
Added test for update and schedule date
1 parent 3df31b8 commit addd302

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/LinkDotNet.Blog.UnitTests/Domain/BlogPostTests.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,15 @@ public void ShouldThrowErrorWhenCreatingBlogPostThatIsPublishedAndHasScheduledPu
9090

9191
action.Should().Throw<InvalidOperationException>();
9292
}
93+
94+
[Fact]
95+
public void ShouldUpdateScheduledPublishDate()
96+
{
97+
var blogPost = new BlogPostBuilder().Build();
98+
var bp = new BlogPostBuilder().IsPublished(false).WithScheduledPublishDate(new DateTime(2023, 3, 24)).Build();
99+
100+
blogPost.Update(bp);
101+
102+
blogPost.ScheduledPublishDate.Should().Be(new DateTime(2023, 3, 24));
103+
}
93104
}

0 commit comments

Comments
 (0)