Ejemplo n.º 1
0
        public void ShouldGetDefaultValuesIfNoBefaviourSet()
        {
            // arrange
            var stubProvider = new FakeRolesInRolesProvider();

            // act & assert
            stubProvider.FindRolesInRole(null, null, false).Should().BeEmpty();
            stubProvider.FindUsersInRole(null, null, false).Should().BeEmpty();
            stubProvider.GetAllRoles(false).Should().BeEmpty();
            stubProvider.GetCreatorOwnerRole().Should().Be(Role.FromName("Creator-Owner"));
            stubProvider.GetEveryoneRole().Should().Be(Role.FromName("Everyone"));
            stubProvider.GetEveryoneRoles().Should().BeEmpty();
            stubProvider.GetGlobalRoles().Should().BeEmpty();
            stubProvider.GetRoleMembers(null, true).Should().BeEmpty();
            stubProvider.GetRolesForRole(null, true).Should().BeEmpty();
            stubProvider.GetRolesForUser(null, true).Should().BeEmpty();
            stubProvider.GetRolesInRole(null, true).Should().BeEmpty();
            stubProvider.GetSystemRoles().Should().BeEmpty();
            stubProvider.GetUsersInRole(null, true).Should().BeEmpty();
            stubProvider.IsCreatorOwnerRole(null).Should().BeFalse();
            stubProvider.IsEveryoneRole("Everyone").Should().BeTrue();
            stubProvider.IsEveryoneRole("Everyone", Domain.GetDomain("extranet")).Should().BeTrue();
            stubProvider.IsGlobalRole(null).Should().BeFalse();
            stubProvider.IsRoleInRole(null, null, true).Should().BeFalse();
            stubProvider.IsSystemRole(null).Should().BeFalse();
            stubProvider.IsUserInRole(null, null, true).Should().BeFalse();
        }
Ejemplo n.º 2
0
        public void ShouldNotThrowIfNoBefaviourSet()
        {
            // arrange
            var stubProvider = new FakeRolesInRolesProvider();

            // act & assert
            stubProvider.AddRolesToRoles(null, null);
            stubProvider.FindRolesInRole(null, null, false);
            stubProvider.FindUsersInRole(null, null, false);
            stubProvider.GetAllRoles(false);
            stubProvider.GetCreatorOwnerRole();
            stubProvider.GetEveryoneRole();
            stubProvider.GetEveryoneRoles();
            stubProvider.GetGlobalRoles();
            stubProvider.GetRoleMembers(null, true);
            stubProvider.GetRolesForRole(null, true);
            stubProvider.GetRolesForUser(null, true);
            stubProvider.GetRolesInRole(null, true);
            stubProvider.GetSystemRoles();
            stubProvider.GetUsersInRole(null, true);
            stubProvider.IsCreatorOwnerRole(null);
            stubProvider.IsEveryoneRole("Everyone");
            stubProvider.IsEveryoneRole("Everyone", Domain.GetDomain("exranet"));
            stubProvider.IsGlobalRole(null);
            stubProvider.IsRoleInRole(null, null, true);
            stubProvider.IsSystemRole(null);
            stubProvider.IsUserInRole(null, null, true);
            stubProvider.RemoveRoleRelations(null);
            stubProvider.RemoveRolesFromRoles(null, null);
        }
    public void ShouldNotThrowIfNoBefaviourSet()
    {
      // arrange
      var stubProvider = new FakeRolesInRolesProvider();

      // act & assert
      stubProvider.AddRolesToRoles(null, null);
      stubProvider.FindRolesInRole(null, null, false);
      stubProvider.FindUsersInRole(null, null, false);
      stubProvider.GetAllRoles(false);
      stubProvider.GetCreatorOwnerRole();
      stubProvider.GetEveryoneRole();
      stubProvider.GetEveryoneRoles();
      stubProvider.GetGlobalRoles();
      stubProvider.GetRoleMembers(null, true);
      stubProvider.GetRolesForRole(null, true);
      stubProvider.GetRolesForUser(null, true);
      stubProvider.GetRolesInRole(null, true);
      stubProvider.GetSystemRoles();
      stubProvider.GetUsersInRole(null, true);
      stubProvider.IsCreatorOwnerRole(null);
      stubProvider.IsEveryoneRole("Everyone");
      stubProvider.IsEveryoneRole("Everyone", Domain.GetDomain("exranet"));
      stubProvider.IsGlobalRole(null);
      stubProvider.IsRoleInRole(null, null, true);
      stubProvider.IsSystemRole(null);
      stubProvider.IsUserInRole(null, null, true);
      stubProvider.RemoveRoleRelations(null);
      stubProvider.RemoveRolesFromRoles(null, null);
    }
    public void ShouldGetDefaultValuesIfNoBefaviourSet()
    {
      // arrange
      var stubProvider = new FakeRolesInRolesProvider();

      // act & assert
      stubProvider.FindRolesInRole(null, null, false).Should().BeEmpty();
      stubProvider.FindUsersInRole(null, null, false).Should().BeEmpty();
      stubProvider.GetAllRoles(false).Should().BeEmpty();
      stubProvider.GetCreatorOwnerRole().Should().Be(Role.FromName("Creator-Owner"));
      stubProvider.GetEveryoneRole().Should().Be(Role.FromName("Everyone"));
      stubProvider.GetEveryoneRoles().Should().BeEmpty();
      stubProvider.GetGlobalRoles().Should().BeEmpty();
      stubProvider.GetRoleMembers(null, true).Should().BeEmpty();
      stubProvider.GetRolesForRole(null, true).Should().BeEmpty();
      stubProvider.GetRolesForUser(null, true).Should().BeEmpty();
      stubProvider.GetRolesInRole(null, true).Should().BeEmpty();
      stubProvider.GetSystemRoles().Should().BeEmpty();
      stubProvider.GetUsersInRole(null, true).Should().BeEmpty();
      stubProvider.IsCreatorOwnerRole(null).Should().BeFalse();
      stubProvider.IsEveryoneRole("Everyone").Should().BeTrue();
      stubProvider.IsEveryoneRole("Everyone", Domain.GetDomain("extranet")).Should().BeTrue();
      stubProvider.IsGlobalRole(null).Should().BeFalse();
      stubProvider.IsRoleInRole(null, null, true).Should().BeFalse();
      stubProvider.IsSystemRole(null).Should().BeFalse();
      stubProvider.IsUserInRole(null, null, true).Should().BeFalse();
    }