-
Couldn't load subscription status.
- Fork 1
HEEDLS-546 All delegates - register delegate - Page 3,4,5 #475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ibrahimmunir14
merged 21 commits into
master
from
HEEDLS-546-all-delegates-register-3-4-5
Jul 15, 2021
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
48f88cd
HEEDLS-546 Delegate registration by centre: WelcomeEmail page GET
ibrahimmunir14 2d171a7
HEEDLS-546 Add date validation to WelcomeEmail POST; display date fie…
ibrahimmunir14 d6e698e
HEEDLS-546 Read/write between ViewModel and Data on WelcomeEmail GET/…
ibrahimmunir14 2239a71
HEEDLS-546 Add empty constructor to WelcomeEmail viewmodel
ibrahimmunir14 0b236c8
HEEDLS-546 Delegate registration by centre: Password page
ibrahimmunir14 15555ec
HEEDLS-546 Delegate registration by centre: Summary page
ibrahimmunir14 1f71475
HEEDLS-546 Fix and tidy up welcome email date and password set
ibrahimmunir14 55da6b5
HEEDLS-546 Change back link on Summary to return to correct previous …
ibrahimmunir14 51297cc
HEEDLS-546 Make password non-required; clear password hash if welcome…
ibrahimmunir14 daf6cea
Merge branch 'master' into HEEDLS-546-all-delegates-register-3-4-5
ibrahimmunir14 20c36c0
HEEDLS-546 Create and use DateInput view component
ibrahimmunir14 052b2bd
HEEDLS-546 Add appropriate css classes to display error border
ibrahimmunir14 1873ffb
HEEDLS-546 Fix spacing on PersonalInformation page
ibrahimmunir14 8b4250c
HEEDLS-546 Fix bug where Alias was not set correctly; write DelegateR…
ibrahimmunir14 544fc2a
Merge remote-tracking branch 'origin/master' into HEEDLS-546-all-dele…
ibrahimmunir14 884a8ef
HEEDLS-546 Move RDbyC viewmodels into Register/RDbyC folder
ibrahimmunir14 8a8450b
HEEDLS-546 Tidy up WelcomeEmailDate string formatting; use derived fi…
ibrahimmunir14 f1c87ec
HEEDLS-546 Rename PasswordVM to ConfirmPasswordVM; move PasswordVM fr…
ibrahimmunir14 2591d05
HEEDLS-546 Review markups: minor formatting/refactoring
ibrahimmunir14 917092f
HEEDLS-546 Move ids into variables/consts; use Id param instead of Name
ibrahimmunir14 48b7f07
HEEDLS-546 Rename a WelcomeEmailVM function
ibrahimmunir14 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
77 changes: 77 additions & 0 deletions
77
DigitalLearningSolutions.Web.Tests/Models/DelegateRegistrationByCentreDataTests.cs
This file contains hidden or 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,77 @@ | ||
| namespace DigitalLearningSolutions.Web.Tests.Models | ||
| { | ||
| using System; | ||
| using DigitalLearningSolutions.Web.Models; | ||
| using DigitalLearningSolutions.Web.ViewModels.Register; | ||
| using DigitalLearningSolutions.Web.ViewModels.Register.RegisterDelegateByCentre; | ||
| using FluentAssertions; | ||
| using NUnit.Framework; | ||
|
|
||
| internal class DelegateRegistrationByCentreDataTests | ||
| { | ||
| private const string FirstName = "Test"; | ||
| private const string LastName = "User"; | ||
| private const string Email = "test@email.com"; | ||
| private const string Alias = "testuser"; | ||
| private const int CentreId = 5; | ||
|
|
||
| [Test] | ||
| public void SetPersonalInformation_sets_data_correctly() | ||
| { | ||
| // Given | ||
| var model = new PersonalInformationViewModel | ||
| { | ||
| FirstName = FirstName, | ||
| LastName = LastName, | ||
| Centre = CentreId, | ||
| Email = Email, | ||
| Alias = Alias | ||
| }; | ||
| var data = new DelegateRegistrationByCentreData(); | ||
|
|
||
| // When | ||
| data.SetPersonalInformation(model); | ||
|
|
||
| // Then | ||
| data.FirstName.Should().Be(FirstName); | ||
| data.LastName.Should().Be(LastName); | ||
| data.Email.Should().Be(Email); | ||
| data.Centre.Should().Be(CentreId); | ||
| data.Alias.Should().Be(Alias); | ||
| } | ||
|
|
||
| [Test] | ||
| public void SetWelcomeEmail_with_ShouldSendEmail_false_sets_data_correctly() | ||
| { | ||
| // Given | ||
| var model = new WelcomeEmailViewModel { ShouldSendEmail = false, Day = 7, Month = 7, Year = 2200 }; | ||
| var data = new DelegateRegistrationByCentreData(); | ||
|
|
||
| // When | ||
| data.SetWelcomeEmail(model); | ||
|
|
||
| // Then | ||
| data.ShouldSendEmail.Should().BeFalse(); | ||
| data.WelcomeEmailDate.Should().BeNull(); | ||
| } | ||
|
|
||
| [Test] | ||
| public void SetWelcomeEmail_with_ShouldSendEmail_true_sets_data_correctly() | ||
| { | ||
| // Given | ||
| var date = new DateTime(2200, 7, 7); | ||
| var model = new WelcomeEmailViewModel | ||
| { ShouldSendEmail = true, Day = date.Day, Month = date.Month, Year = date.Year }; | ||
| var data = new DelegateRegistrationByCentreData(); | ||
|
|
||
| // When | ||
| data.SetWelcomeEmail(model); | ||
|
|
||
| // Then | ||
| data.ShouldSendEmail.Should().BeTrue(); | ||
| data.WelcomeEmailDate.Should().Be(date); | ||
| data.IsPasswordSet.Should().BeFalse(); | ||
| data.PasswordHash.Should().BeNull(); | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to add any tests about temp data being updated appropriately?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've already written tests for populating DelegtateRegistrationbyCentreData from viewmodels. Is that enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if someone refactors this file and forgets to update TempData? I guess we could catch that in the AutomatedUI tests, when we do accessibility scans of the pages (which I'm happy for you to add as part of whichever subtask)