예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldMakeNiceDescriptionAuthDisabledAndRestricted()
        public virtual void ShouldMakeNiceDescriptionAuthDisabledAndRestricted()
        {
            EnterpriseSecurityContext disabled   = EnterpriseSecurityContext.AUTH_DISABLED;
            EnterpriseSecurityContext restricted = disabled.WithMode(new RestrictedAccessMode(disabled.Mode(), [email protected]_Static.Read));

            assertThat(restricted.Description(), equalTo("AUTH_DISABLED with FULL restricted to READ"));
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldMakeNiceDescriptionWithMode() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldMakeNiceDescriptionWithMode()
        {
            _manager.newRole("role1", "mats");
            _manager.addRoleToUser(PUBLISHER, "mats");

            EnterpriseSecurityContext modified = Context().withMode([email protected]_Static.CredentialsExpired);

            assertThat(modified.Description(), equalTo("user 'mats' with CREDENTIALS_EXPIRED"));
        }
예제 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldMakeNiceDescriptionOverridden() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldMakeNiceDescriptionOverridden()
        {
            _manager.newRole("role1", "mats");
            _manager.addRoleToUser(PUBLISHER, "mats");

            EnterpriseSecurityContext context    = context();
            EnterpriseSecurityContext overridden = context.WithMode(new OverriddenAccessMode(context.Mode(), [email protected]_Static.Read));

            assertThat(overridden.Description(), equalTo("user 'mats' with roles [publisher,role1] overridden by READ"));
        }
예제 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldMakeNiceDescriptionAuthDisabled()
        public virtual void ShouldMakeNiceDescriptionAuthDisabled()
        {
            EnterpriseSecurityContext disabled = EnterpriseSecurityContext.AUTH_DISABLED;

            assertThat(disabled.Description(), equalTo("AUTH_DISABLED with FULL"));
        }