Exemplo n.º 1
0
        public void CanDisable_should_throw_exception_if_ui_field()
        {
            var command = new DisableField {
                FieldId = 4
            };

            Assert.Throws <DomainException>(() => GuardSchemaField.CanDisable(command, schema_0));
        }
Exemplo n.º 2
0
        public void CanDisable_Should_not_throw_exception_if_enabled()
        {
            var command = new DisableField {
                FieldId = 1
            };

            GuardSchemaField.CanDisable(schema_0, command);
        }
Exemplo n.º 3
0
        public void CanDisable_should_throw_exception_if_not_found()
        {
            var command = new DisableField {
                FieldId = 3
            };

            Assert.Throws <DomainObjectNotFoundException>(() => GuardSchemaField.CanDisable(schema_0, command));
        }
Exemplo n.º 4
0
        public void CanDisable_should_not_throw_exception_if_already_disabled()
        {
            var command = new DisableField {
                FieldId = 1
            };

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

            GuardSchemaField.CanDisable(command, schema_1);
        }
Exemplo n.º 5
0
        public void CanDisable_should_throw_exception_if_locked()
        {
            var command = new DisableField {
                FieldId = 1
            };

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

            Assert.Throws <DomainException>(() => GuardSchemaField.CanDisable(command, schema_1));
        }
Exemplo n.º 6
0
        public void CanDisable_should_throw_exception_if_already_disabled()
        {
            var command = new DisableField {
                FieldId = 1
            };

            var schema_1 = schema_0.DisableField(1);

            Assert.Throws <DomainException>(() => GuardSchemaField.CanDisable(schema_1, command));
        }