Skip to content

Commit

Permalink
ShouldThrowValidationExceptionIfNoReceiverWasAdded -> PASS
Browse files Browse the repository at this point in the history
  • Loading branch information
mabroukmahdhi committed Aug 11, 2024
1 parent 5026f76 commit f04a093
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,7 @@ public async void ShouldThrowValidationExceptionIfNoReceiverWasAdded()

invalidFlexiMessageException.AddData(
key: nameof(FlexiMessage.To),
values: "Value is not set");

invalidFlexiMessageException.AddData(
key: nameof(FlexiMessage.Cc),
values: "Value is not set");

invalidFlexiMessageException.AddData(
key: nameof(FlexiMessage.Bcc),
values: "Value is not set");
values: "Value is not set");

var expectedFlexiMessageValidationException =
new FlexiMessageValidationException(
Expand Down
6 changes: 3 additions & 3 deletions FlexiMail/Services/FlexiExchangeService.Validations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ private static void ValidFlexiMessage(FlexiMessage flexiMessage)
{
ValidFlexiMessageIsNotNull(flexiMessage);

Validate((Rule: IsInvalid(flexiMessage.To), Parameter: nameof(FlexiMessage.To)),
(Rule: IsInvalid(flexiMessage.Cc), Parameter: nameof(FlexiMessage.Cc)),
(Rule: IsInvalid(flexiMessage.Bcc), Parameter: nameof(FlexiMessage.Bcc)));
Validate((Rule: IsInvalid(flexiMessage.To), Parameter: nameof(FlexiMessage.To)));
Validate((Rule: IsInvalid(flexiMessage.Cc), Parameter: nameof(FlexiMessage.Cc)));
Validate((Rule: IsInvalid(flexiMessage.Bcc), Parameter: nameof(FlexiMessage.Bcc)));
}

private static void ValidFlexiMessageIsNotNull(FlexiMessage flexiMessage)
Expand Down

0 comments on commit f04a093

Please sign in to comment.