-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add creation channels to remaining endpoints
- Loading branch information
Showing
9 changed files
with
243 additions
and
9 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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
using System; | ||
using System.Linq; | ||
using FluentAssertions; | ||
using FluentValidation.TestHelper; | ||
using GetIntoTeachingApi.Models.GetIntoTeaching; | ||
using GetIntoTeachingApi.Models.GetIntoTeaching.Validators; | ||
|
@@ -20,6 +22,34 @@ public GetIntoTeachingCallbackValidatorTests() | |
_validator = new GetIntoTeachingCallbackValidator(_mockStore.Object, new DateTimeProvider()); | ||
_callback = new GetIntoTeachingCallback(); | ||
} | ||
|
||
[Fact] | ||
public void Validate_WhenValid_HasNoErrors() | ||
{ | ||
// var mockPickListItem = new PickListItem { Id = 123 }; | ||
// var mockSubject = new TeachingSubject { Id = Guid.NewGuid() }; | ||
// var mockPrivacyPolicy = new PrivacyPolicy { Id = Guid.NewGuid() }; | ||
|
||
var request = new GetIntoTeachingCallback() | ||
{ | ||
FirstName = "John", | ||
LastName = "Doe", | ||
Email = "[email protected]", | ||
AcceptedPolicyId = Guid.NewGuid(), | ||
AddressTelephone = "123456789", | ||
PhoneCallScheduledAt = DateTime.UtcNow.AddDays(1), | ||
TalkingPoints = "Talking points", | ||
CreationChannelSourceId = 222750003, | ||
CreationChannelServiceId = 222750002, | ||
CreationChannelActivityId = 222750001, | ||
}; | ||
|
||
var result = _validator.TestValidate(request); | ||
// Ensure no validation errors on root object (we expect errors on the Candidate | ||
// properties as we can't mock them). | ||
var propertiesWithErrors = result.Errors.Select(e => e.PropertyName); | ||
propertiesWithErrors.All(p => p.StartsWith("Candidate.")).Should().BeTrue(); | ||
} | ||
|
||
[Fact] | ||
public void Validate_RequiredFieldsWhenNull_HasError() | ||
|
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.