public void CanReorder_should_throw_exception_if_field_ids_null() { var command = new ReorderFields { FieldIds = null }; Assert.Throws <ValidationException>(() => GuardSchema.CanReorder(schema_0, command)); }
public void CanReorder_should_throw_exception_if_field_ids_null() { var command = new ReorderFields { FieldIds = null }; ValidationAssert.Throws(() => GuardSchema.CanReorder(schema_0, command), new ValidationError("Field ids is required.", "FieldIds")); }
public void CanReorder_should_not_throw_exception_if_field_ids_are_valid() { var command = new ReorderFields { FieldIds = new List <long> { 1, 2 } }; GuardSchema.CanReorder(schema_0, command); }
public void CanReorder_should_throw_exception_if_parent_field_not_found() { var command = new ReorderFields { FieldIds = new List <long> { 1, 2 }, ParentFieldId = 99 }; Assert.Throws <DomainObjectNotFoundException>(() => GuardSchema.CanReorder(schema_0, command)); }
public void CanReorder_should_throw_exception_if_field_ids_do_not_covers_all_fields() { var command = new ReorderFields { FieldIds = new List <long> { 1 } }; Assert.Throws <ValidationException>(() => GuardSchema.CanReorder(schema_0, command)); }
public void CanReorder_should_throw_exception_if_field_ids_contains_invalid_id() { var command = new ReorderFields { FieldIds = new List <long> { 1, 3 } }; Assert.Throws <ValidationException>(() => GuardSchema.CanReorder(schema_0, command)); }
public void CanReorder_should_throw_exception_if_field_ids_do_not_covers_all_fields() { var command = new ReorderFields { FieldIds = new List <long> { 1 } }; ValidationAssert.Throws(() => GuardSchema.CanReorder(schema_0, command), new ValidationError("Field ids do not cover all fields.", "FieldIds")); }