Example #1
0
            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());
                    }
                }
            }
Example #2
0
        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());
        }
Example #3
0
 public override int ResultSize()
 {
     return(_range.Size());
 }
Example #4
0
 private void AssertSize(int size, IBTreeRange range)
 {
     Assert.AreEqual(size, range.Size());
 }
Example #5
0
		private void AssertSize(int size, IBTreeRange range)
		{
			Assert.AreEqual(size, range.Size());
		}
Example #6
0
 public virtual int ResultSize()
 {
     return(_range.Size());
 }