public FakeRoleProviderTest() { this.localProvider = Substitute.For<RoleProvider>(); this.provider = new FakeRoleProvider(); this.provider.LocalProvider.Value = this.localProvider; this.roles = new[] { @"sitecore\Editors", @"sitecore\Authors" }; this.users = new[] { @"sitecore\John", @"sitecore\Jane" }; }
public void ShouldDoNothingIfNoBehaviourSet() { // arrange var stubProvider = new FakeRoleProvider(); // act & assert Assert.Null(stubProvider.ApplicationName); stubProvider.AddUsersToRoles(null, null); stubProvider.CreateRole(null); stubProvider.DeleteRole(null, false).Should().BeFalse(); stubProvider.FindUsersInRole(null, null).Should().BeEmpty(); stubProvider.GetAllRoles().Should().BeEmpty(); stubProvider.GetRolesForUser(null).Should().BeEmpty(); stubProvider.GetUsersInRole(null).Should().BeEmpty(); stubProvider.IsUserInRole(null, null).Should().BeFalse(); stubProvider.RemoveUsersFromRoles(null, null); stubProvider.RoleExists(null).Should().BeFalse(); }