Пример #1
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));
        }
Пример #2
0
        public void CanHide_should_throw_exception_if_already_hidden()
        {
            var command = new HideField {
                FieldId = 1
            };

            var schema_1 = schema_0.HideField(1);

            Assert.Throws <DomainException>(() => GuardSchemaField.CanHide(schema_1, command));
        }
Пример #3
0
        public void CanUpdate_should_throw_exception_if_locked()
        {
            var command = new UpdateField {
                FieldId = 1, Properties = new StringFieldProperties()
            };

            var schema_1 = schema_0.LockField(1);

            Assert.Throws <DomainException>(() => GuardSchemaField.CanUpdate(schema_1, command));
        }
Пример #4
0
        public void CanDelete_should_throw_exception_if_locked()
        {
            var command = new DeleteField {
                FieldId = 1
            };

            var schema_1 = schema_0.LockField(1);

            Assert.Throws <DomainException>(() => GuardSchemaField.CanDelete(schema_1, command));
        }
Пример #5
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);
        }
Пример #6
0
        public void CanShow_should_not_throw_exception_if_hidden()
        {
            var command = new ShowField {
                FieldId = 1
            };

            var schema_1 = schema_0.HideField(1);

            GuardSchemaField.CanShow(schema_1, command);
        }