Example #1
0
        public void CanEnable_should_throw_exception_if_ui_field()
        {
            var command = new EnableField {
                FieldId = 4
            };

            Assert.Throws <DomainException>(() => GuardSchemaField.CanEnable(command, schema_0));
        }
Example #2
0
        public void CanEnable_should_throw_exception_if_not_found()
        {
            var command = new EnableField {
                FieldId = 3
            };

            Assert.Throws <DomainObjectNotFoundException>(() => GuardSchemaField.CanEnable(schema_0, command));
        }
Example #3
0
        public void CanEnable_should_throw_exception_if_already_enabled()
        {
            var command = new EnableField {
                FieldId = 1
            };

            Assert.Throws <DomainException>(() => GuardSchemaField.CanEnable(schema_0, command));
        }
Example #4
0
        public void CanShow_should_not_throw_exception_if_already_shown()
        {
            var command = new EnableField {
                FieldId = 1
            };

            var schema_1 = schema_0.UpdateField(1, f => f.Show());

            GuardSchemaField.CanEnable(command, schema_1);
        }
Example #5
0
        public void CanEnable_should_throw_exception_if_locked()
        {
            var command = new EnableField {
                FieldId = 1
            };

            var schema_1 = schema_0.UpdateField(1, f => f.Lock());

            Assert.Throws <DomainException>(() => GuardSchemaField.CanEnable(command, schema_1));
        }
Example #6
0
        public void CanEnable_should_not_throw_exception_if_disabled()
        {
            var command = new EnableField {
                FieldId = 1
            };

            var schema_1 = schema_0.DisableField(1);

            GuardSchemaField.CanEnable(schema_1, command);
        }