forked from umbraco/Umbraco-CMS
-
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.
Fix casing issue in member group service/repo
- Loading branch information
Stephan
committed
Oct 1, 2018
1 parent
328b4b1
commit eda6e08
Showing
2 changed files
with
25 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -288,6 +288,29 @@ public void Associate_Members_To_Roles_With_Member_Id() | |
Assert.AreEqual(2, membersInRole.Count()); | ||
} | ||
|
||
[Test] | ||
public void Associate_Members_To_Roles_With_Member_Id_Casing() | ||
{ | ||
ServiceContext.MemberService.AddRole("MyTestRole1"); | ||
|
||
IMemberType memberType = MockedContentTypes.CreateSimpleMemberType(); | ||
ServiceContext.MemberTypeService.Save(memberType); | ||
var member1 = MockedMember.CreateSimpleMember(memberType, "test1", "[email protected]", "pass", "test1"); | ||
ServiceContext.MemberService.Save(member1); | ||
var member2 = MockedMember.CreateSimpleMember(memberType, "test2", "[email protected]", "pass", "test2"); | ||
ServiceContext.MemberService.Save(member2); | ||
|
||
// temp make sure they exist | ||
Assert.IsNotNull(ServiceContext.MemberService.GetById(member1.Id)); | ||
Assert.IsNotNull(ServiceContext.MemberService.GetById(member2.Id)); | ||
|
||
ServiceContext.MemberService.AssignRoles(new[] { member1.Id, member2.Id }, new[] { "mytestrole1" }); | ||
|
||
var membersInRole = ServiceContext.MemberService.GetMembersInRole("MyTestRole1"); | ||
|
||
Assert.AreEqual(2, membersInRole.Count()); | ||
} | ||
|
||
[Test] | ||
public void Associate_Members_To_Roles_With_Member_Username() | ||
{ | ||
|
@@ -1179,4 +1202,4 @@ public void Ensure_Content_Xml_Created() | |
} | ||
|
||
} | ||
} | ||
} |