public void GiveAnNewlyCreatedNote_WhenGettingEmailAddress_ThenValueShouldBeSameAsPassedInConstructor() { // arrange Note subject = new NoteBuilder() .WithEmailAddress(new EmailAddress("*****@*****.**")) .Build(); // act EmailAddress result = subject.EmailAddress; // assert result.Should().Be(new EmailAddress("*****@*****.**")); }
public void GiveAnNewlyCreatedNote_WhenGettingTitle_ThenValueShouldBeSameAsPassedInConstructor() { // arrange Note subject = new NoteBuilder() .WithTitle("title") .Build(); // act string result = subject.Title; // assert result.Should().Be("title"); }
public void GiveAnNewlyCreatedNote_WhenGettingCreatingDate_ThenValueShouldBeAroundConstructionTime() { // arrange DateTime before = DateTime.Now; Note subject = new NoteBuilder() .WithTitle("title") .Build(); DateTime after = DateTime.Now; // act DateTime result = subject.CreationDateTime; // assert result. Should().BeOnOrAfter(before) .And.BeOnOrBefore(after); }
public void WhenCreatingAnNewNoteWithNullForMessage_ThenShouldThrowArgumentNullException() { // arrange NoteBuilder subjectBuilder = new NoteBuilder() .WithMessage(null); // act Action act = () => subjectBuilder.Build(); // assert act.ShouldThrow<ArgumentNullException>(); }