Update UserServiceTests.cs

This commit is contained in:
Alain
2015-01-05 19:04:59 +00:00
parent d06ff5f108
commit dea78c5d13

View File

@@ -451,6 +451,24 @@ namespace Umbraco.Tests.Services
}
[Test]
public void Can_Add_Section_To_All_Users()
{
var userType = ServiceContext.UserService.GetUserTypeByAlias("admin");
var user1 = ServiceContext.UserService.CreateUserWithIdentity("test1", "test1@test.com", userType);
var user2 = ServiceContext.UserService.CreateUserWithIdentity("test2", "test2@test.com", userType);
//now add the section to all users
ServiceContext.UserService.AddSectionToAllUsers("test");
//assert
var result1 = ServiceContext.UserService.GetUserById((int)user1.Id);
var result2 = ServiceContext.UserService.GetUserById((int)user2.Id);
Assert.IsFalse(result1.AllowedSections.Contains("test"));
Assert.IsFalse(result2.AllowedSections.Contains("test"));
}
[Test]
public void Get_By_Profile_Username()
{
@@ -512,4 +530,4 @@ namespace Umbraco.Tests.Services
Assert.That(updatedItem.AllowedSections.Count(), Is.EqualTo(0));
}
}
}
}