private void EnsureSingleOccurence(Transaction trans, IObjectInfoCollection col) { IEnumerator i = col.GetEnumerator(); while (i.MoveNext()) { IObjectInfo objectInfo = (IObjectInfo)i.Current; if (this.ReflectClass() != this._enclosing.ReflectorFor(trans, objectInfo.GetObject ())) { continue; } object obj = this.ObjectFor(trans, objectInfo); object fieldValue = this.FieldMetadata().GetOn(trans, obj); if (fieldValue == null) { continue; } IBTreeRange range = this.FieldMetadata().Search(trans, fieldValue); if (range.Size() > 1) { throw new UniqueFieldValueConstraintViolationException(this.ClassMetadata().GetName (), this.FieldMetadata().GetName()); } } }
protected virtual void AssertFieldIndex(int id) { IReflectClass claxx = Reflector().ForClass(typeof(TPFieldIndexConsistencyTestCaseBase.Item )); ClassMetadata classMetadata = FileSession().ClassMetadataForReflectClass(claxx); FieldMetadata field = classMetadata.FieldMetadataForName(IdFieldName); IBTreeRange indexRange = field.Search(Trans(), id); Assert.AreEqual(1, indexRange.Size()); }
public override int ResultSize() { return(_range.Size()); }
private void AssertSize(int size, IBTreeRange range) { Assert.AreEqual(size, range.Size()); }
public virtual int ResultSize() { return(_range.Size()); }