コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldInitUpdatePermission()
        public virtual void shouldInitUpdatePermission()
        {
            TestProcessEngineCfg testProcessEngineCfg = new TestProcessEngineCfg();

            // given
            testProcessEngineCfg.DefaultUserPermissionNameForTask = "UPDATE";

            // if
            testProcessEngineCfg.initDefaultUserPermissionForTask();

            // then
            assertEquals(Permissions.UPDATE, testProcessEngineCfg.DefaultUserPermissionForTask);
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldInitTaskWorkPermission()
        public virtual void shouldInitTaskWorkPermission()
        {
            TestProcessEngineCfg testProcessEngineCfg = new TestProcessEngineCfg();

            // given
            testProcessEngineCfg.DefaultUserPermissionNameForTask = "TASK_WORK";

            // if
            testProcessEngineCfg.initDefaultUserPermissionForTask();

            // then
            assertEquals(Permissions.TASK_WORK, testProcessEngineCfg.DefaultUserPermissionForTask);
        }
コード例 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotInitIfAlreadySet()
        public virtual void shouldNotInitIfAlreadySet()
        {
            TestProcessEngineCfg testProcessEngineCfg = new TestProcessEngineCfg();

            // given
            testProcessEngineCfg.DefaultUserPermissionForTask = Permissions.ALL;

            // if
            testProcessEngineCfg.initDefaultUserPermissionForTask();

            // then
            assertEquals(Permissions.ALL, testProcessEngineCfg.DefaultUserPermissionForTask);
        }
コード例 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldThrowExceptionOnNullPermissionName()
        public virtual void shouldThrowExceptionOnNullPermissionName()
        {
            TestProcessEngineCfg testProcessEngineCfg = new TestProcessEngineCfg();

            // given
            testProcessEngineCfg.DefaultUserPermissionNameForTask = null;

            // if
            try
            {
                testProcessEngineCfg.initDefaultUserPermissionForTask();
                fail("Exception expected");
            }
            catch (ProcessEngineException e)
            {
                string expectedExceptionMessage = "Invalid value 'null' for configuration property 'defaultUserPermissionNameForTask'.";
                assertThat(e.Message, containsString(expectedExceptionMessage));
            }
        }
コード例 #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldThrowExceptionOnUnsupportedPermission()
        public virtual void shouldThrowExceptionOnUnsupportedPermission()
        {
            TestProcessEngineCfg testProcessEngineCfg = new TestProcessEngineCfg();

            // given
            testProcessEngineCfg.DefaultUserPermissionNameForTask = "UNSUPPORTED";

            // if
            try
            {
                testProcessEngineCfg.initDefaultUserPermissionForTask();
                fail("Exception expected");
            }
            catch (ProcessEngineException e)
            {
                string expectedExceptionMessage = string.Format("Invalid value '{0}' for configuration property 'defaultUserPermissionNameForTask'.", "UNSUPPORTED");
                assertThat(e.Message, containsString(expectedExceptionMessage));
            }
        }