Combined test user/group test objects created for repository and service tests.
This commit is contained in:
@@ -209,6 +209,16 @@ namespace Umbraco.Tests.Common.Builders
|
||||
return list;
|
||||
}
|
||||
|
||||
public static User CreateUser(string suffix = "")
|
||||
{
|
||||
return new UserBuilder()
|
||||
.WithIsApproved(true)
|
||||
.WithName("TestUser" + suffix)
|
||||
.WithLogin("TestUser" + suffix, "testing")
|
||||
.WithEmail("test" + suffix + "@test.com")
|
||||
.Build();
|
||||
}
|
||||
|
||||
int? IWithIdBuilder.Id
|
||||
{
|
||||
get => _id;
|
||||
|
||||
@@ -122,11 +122,11 @@ namespace Umbraco.Tests.Common.Builders
|
||||
return userGroup;
|
||||
}
|
||||
|
||||
public static UserGroup CreateUserGroup(string suffix = "", string[] permissions = null, string[] allowedSections = null)
|
||||
public static UserGroup CreateUserGroup(string alias = "testGroup", string name = "Test Group", string suffix = "", string[] permissions = null, string[] allowedSections = null)
|
||||
{
|
||||
return (UserGroup)new UserGroupBuilder()
|
||||
.WithAlias("testUserGroup" + suffix)
|
||||
.WithName("TestUserGroup" + suffix)
|
||||
.WithAlias(alias + suffix)
|
||||
.WithName(name + suffix)
|
||||
.WithPermissions(permissions ?? new[] { "A", "B", "C" })
|
||||
.WithAllowedSections(allowedSections ?? new[] { "content", "media" })
|
||||
.Build();
|
||||
|
||||
Reference in New Issue
Block a user