-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VIH-10126 update default value for IsMultiDayHearing and AudioRecordi…
…ngRequired (#713) Update swagger doc to use fluent validation rules
- Loading branch information
1 parent
ff1e1bd
commit 754513f
Showing
23 changed files
with
129 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ public async Task Should_Return_Missing_Participant_Email_Error() | |
|
||
result.IsValid.Should().BeFalse(); | ||
result.Errors.Count.Should().Be(1); | ||
result.Errors.Any(x => x.ErrorMessage == LinkedParticipantRequestValidationV2.NoParticipantEmail) | ||
result.Errors.Exists(x => x.ErrorMessage == LinkedParticipantRequestValidationV2.NoParticipantEmail) | ||
.Should().BeTrue(); | ||
} | ||
|
||
|
@@ -47,20 +47,20 @@ public async Task Should_Return_Missing_LinkedParticipant_Email_Error() | |
|
||
result.IsValid.Should().BeFalse(); | ||
result.Errors.Count.Should().Be(1); | ||
result.Errors.Any(x => x.ErrorMessage == LinkedParticipantRequestValidationV2.NoLinkedParticipantEmail) | ||
result.Errors.Exists(x => x.ErrorMessage == LinkedParticipantRequestValidationV2.NoLinkedParticipantEmail) | ||
.Should().BeTrue(); | ||
} | ||
|
||
[Test] | ||
public async Task Should_Return_Invalid_LinkedParticipant_Type_Error() | ||
{ | ||
_requestV2.TypeV2 = (LinkedParticipantTypeV2)456789; | ||
_requestV2.Type = (LinkedParticipantTypeV2)456789; | ||
|
||
var result = await _validator.ValidateAsync(_requestV2); | ||
|
||
result.IsValid.Should().BeFalse(); | ||
result.Errors.Count.Should().Be(1); | ||
result.Errors.Any(x => x.ErrorMessage == LinkedParticipantRequestValidationV2.InvalidType) | ||
result.Errors.Exists(x => x.ErrorMessage == LinkedParticipantRequestValidationV2.InvalidType) | ||
.Should().BeTrue(); | ||
} | ||
|
||
|
@@ -69,7 +69,7 @@ private LinkedParticipantRequestV2 BuildRequest() | |
return Builder<LinkedParticipantRequestV2>.CreateNew() | ||
.With(x => x.ParticipantContactEmail = "[email protected]") | ||
.With(x => x.LinkedParticipantContactEmail = "[email protected]") | ||
.With(x => x.TypeV2 = LinkedParticipantTypeV2.Interpreter) | ||
.With(x => x.Type = LinkedParticipantTypeV2.Interpreter) | ||
.Build(); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
BookingsApi/BookingsApi/Validations/Common/DataInputValidator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using FluentValidation; | ||
|
||
namespace BookingsApi.Validations.Common; | ||
|
||
public interface IRefDataInputValidator{} | ||
|
||
public abstract class RefDataInputValidatorValidator<T> : AbstractValidator<T>, IRefDataInputValidator | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.