-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update tests broken by basic spam blocking in aeb62e0
- Loading branch information
1 parent
487b9fd
commit 9c29991
Showing
1 changed file
with
19 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,7 @@ public void CreateMember_has_form_post_attributes() | |
[Fact] | ||
public async Task Invalid_ModelState_returns_UmbracoPageResult_and_does_not_attempt_to_create_member() | ||
{ | ||
var model = new RegisterModel(); | ||
var model = new CreateMemberFormData(); | ||
using (var controller = CreateController(model, createMemberSucceeds: true)) | ||
{ | ||
controller.ModelState.AddModelError(string.Empty, "Any error"); | ||
|
@@ -138,7 +138,7 @@ public async Task Invalid_ModelState_returns_UmbracoPageResult_and_does_not_atte | |
public async Task Null_model_returns_UmbracoPageResult_and_does_not_attempt_to_create_member() | ||
{ | ||
#nullable disable | ||
RegisterModel model = null; | ||
CreateMemberFormData model = null; | ||
using (var controller = CreateController(model, createMemberSucceeds: true)) | ||
{ | ||
var result = await controller.CreateMember(model); | ||
|
@@ -152,7 +152,7 @@ public async Task Null_model_returns_UmbracoPageResult_and_does_not_attempt_to_c | |
[Fact] | ||
public async Task New_member_returns_RedirectToUmbracoPageResult() | ||
{ | ||
var model = new RegisterModel(); | ||
var model = new CreateMemberFormData(); | ||
model.Email = "[email protected]"; | ||
MemberService.Setup(x => x.GetByEmail(model.Email)).Returns(Mock.Of<IMember>()); | ||
|
||
|
@@ -170,7 +170,7 @@ public async Task New_member_returns_RedirectToUmbracoPageResult() | |
[Fact] | ||
public async Task New_member_saves_email_and_token() | ||
{ | ||
var model = new RegisterModel { Email = "[email protected]" }; | ||
var model = new CreateMemberFormData { Email = "[email protected]" }; | ||
var token = Guid.NewGuid().ToString(); | ||
var tokenExpiry = DateTime.UtcNow.AddDays(1); | ||
var member = new Mock<IMember>(); | ||
|
@@ -195,7 +195,7 @@ public async Task New_member_saves_email_and_token() | |
[Fact] | ||
public async Task New_member_is_assigned_to_All_Members() | ||
{ | ||
var model = new RegisterModel(); | ||
var model = new CreateMemberFormData(); | ||
model.Email = "[email protected]"; | ||
var member = new Mock<IMember>(); | ||
member.SetupGet(x => x.Id).Returns(123); | ||
|
@@ -216,7 +216,7 @@ public async Task New_member_is_assigned_to_All_Members() | |
[Fact] | ||
public async Task New_member_is_not_logged_in_automatically() | ||
{ | ||
var model = new RegisterModel { Email = "[email protected]" }; | ||
var model = new CreateMemberFormData { Email = "[email protected]" }; | ||
var member = new Mock<IMember>(); | ||
member.SetupGet(x => x.Id).Returns(123); | ||
MemberService.Setup(x => x.GetByEmail(model.Email)).Returns(member.Object); | ||
|
@@ -236,7 +236,7 @@ public async Task New_member_is_not_logged_in_automatically() | |
[Fact] | ||
public async Task New_member_sends_Approve_Member_email() | ||
{ | ||
var model = new RegisterModel(); | ||
var model = new CreateMemberFormData(); | ||
model.Name = "Member name"; | ||
model.Email = "[email protected]"; | ||
|
||
|
@@ -276,7 +276,7 @@ public async Task New_member_sends_Approve_Member_email() | |
[Fact] | ||
public async Task Creating_a_new_member_is_logged() | ||
{ | ||
var model = new RegisterModel(); | ||
var model = new CreateMemberFormData(); | ||
model.Email = "[email protected]"; | ||
var member = new Mock<IMember>(); | ||
member.SetupGet(x => x.Id).Returns(123); | ||
|
@@ -299,7 +299,7 @@ public async Task Creating_a_new_member_is_logged() | |
[Fact] | ||
public async Task Fail_to_create_member_does_not_save_additional_properties() | ||
{ | ||
var model = new RegisterModel(); | ||
var model = new CreateMemberFormData(); | ||
model.Email = "[email protected]"; | ||
|
||
var member = new Mock<IMember>(); | ||
|
@@ -317,7 +317,7 @@ public async Task Fail_to_create_member_does_not_save_additional_properties() | |
[Fact] | ||
public async Task Duplicate_email_sends_Member_Exists_email() | ||
{ | ||
var model = new RegisterModel(); | ||
var model = new CreateMemberFormData(); | ||
model.Name = "Member name"; | ||
model.Email = "[email protected]"; | ||
|
||
|
@@ -350,7 +350,7 @@ public async Task Duplicate_email_sends_Member_Exists_email() | |
[Fact] | ||
public async Task Duplicate_email_returns_RedirectToUmbracoPageResult() | ||
{ | ||
var model = new RegisterModel { Email = "[email protected]" }; | ||
var model = new CreateMemberFormData { Email = "[email protected]" }; | ||
|
||
_emailFormatter.Setup(x => x.FormatEmailContent(MEMBER_EXISTS_EMAIL_SUBJECT, MEMBER_EXISTS_EMAIL_BODY, It.IsAny<Dictionary<string, string>>())) | ||
.Returns((MEMBER_EXISTS_EMAIL_SUBJECT, MEMBER_EXISTS_EMAIL_BODY)); | ||
|
@@ -366,7 +366,7 @@ public async Task Duplicate_email_returns_RedirectToUmbracoPageResult() | |
[Fact] | ||
public async Task Duplicate_email_sets_ViewData_FormSuccess_to_true() | ||
{ | ||
var model = new RegisterModel { Email = "[email protected]" }; | ||
var model = new CreateMemberFormData { Email = "[email protected]" }; | ||
|
||
_emailFormatter.Setup(x => x.FormatEmailContent(MEMBER_EXISTS_EMAIL_SUBJECT, MEMBER_EXISTS_EMAIL_BODY, It.IsAny<Dictionary<string, string>>())) | ||
.Returns((MEMBER_EXISTS_EMAIL_SUBJECT, MEMBER_EXISTS_EMAIL_BODY)); | ||
|
@@ -382,7 +382,7 @@ public async Task Duplicate_email_sets_ViewData_FormSuccess_to_true() | |
[Fact] | ||
public async Task Email_matching_requested_email_within_expiry_period_sends_Member_Exists_email() | ||
{ | ||
var model = new RegisterModel(); | ||
var model = new CreateMemberFormData(); | ||
model.Name = "Member name"; | ||
model.Email = "[email protected]"; | ||
|
||
|
@@ -420,7 +420,7 @@ public async Task Email_matching_requested_email_within_expiry_period_sends_Memb | |
[Fact] | ||
public async Task Email_matching_requested_email_within_expiry_period_returns_RedirectToUmbracoPageResult() | ||
{ | ||
var model = new RegisterModel { Email = "[email protected]" }; | ||
var model = new CreateMemberFormData { Email = "[email protected]" }; | ||
|
||
var otherMember = new Mock<IMember>(); | ||
var expiryDate = DateTime.Now.AddHours(12); | ||
|
@@ -442,7 +442,7 @@ public async Task Email_matching_requested_email_within_expiry_period_returns_Re | |
[Fact] | ||
public async Task Email_matching_requested_email_within_expiry_period_sets_ViewData_FormSuccess_to_true() | ||
{ | ||
var model = new RegisterModel { Email = "[email protected]" }; | ||
var model = new CreateMemberFormData { Email = "[email protected]" }; | ||
|
||
var otherMember = new Mock<IMember>(); | ||
var expiryDate = DateTime.Now.AddHours(12); | ||
|
@@ -464,7 +464,7 @@ public async Task Email_matching_requested_email_within_expiry_period_sets_ViewD | |
[Fact] | ||
public async Task Email_matching_requested_email_within_expiry_period_does_not_attempt_to_create_member() | ||
{ | ||
var model = new RegisterModel { Email = "[email protected]" }; | ||
var model = new CreateMemberFormData { Email = "[email protected]" }; | ||
|
||
var otherMember = new Mock<IMember>(); | ||
var expiryDate = DateTime.Now.AddHours(12); | ||
|
@@ -487,7 +487,7 @@ public async Task Email_matching_requested_email_within_expiry_period_does_not_a | |
[Fact] | ||
public async Task Email_matching_requested_email_past_expiry_period_attempts_to_create_member() | ||
{ | ||
var model = new RegisterModel(); | ||
var model = new CreateMemberFormData(); | ||
|
||
var otherMember = new Mock<IMember>(); | ||
var expiryDate = DateTime.Now.AddHours(-12); | ||
|
@@ -508,7 +508,7 @@ public async Task Email_matching_requested_email_past_expiry_period_attempts_to_ | |
[Fact] | ||
public async Task Other_error_is_added_to_ModelState_and_returns_baseResult() | ||
{ | ||
var model = new RegisterModel(); | ||
var model = new CreateMemberFormData(); | ||
using (var controller = CreateController(model, createMemberSucceeds: false, emailFieldError: "Some other error.")) | ||
{ | ||
var result = await controller.CreateMember(model); | ||
|
@@ -522,7 +522,7 @@ public async Task Other_error_is_added_to_ModelState_and_returns_baseResult() | |
[Fact] | ||
public async Task Email_in_TempData_for_view() | ||
{ | ||
var model = new RegisterModel(); | ||
var model = new CreateMemberFormData(); | ||
model.Email = "[email protected]"; | ||
using (var controller = CreateController(model)) | ||
{ | ||
|