Пример #1
0
        protected override void FetchTest(int count)
        {
            long sum     = (long)count * (count - 1) / 2;
            var  scope   = context.GetScope();
            var  classId = scope.PersistentMetaData.GetPersistentTypeDescriptor(typeof(Simplest)).ClassId;

            using (var ts = new TransactionScope()) {
                for (int i = 0; i < count; i++)
                {
                    var id       = (long)i % InstanceCount;
                    var objectId = Database.OID.ParseObjectId(null, classId + "-" + id);
                    var s        = (Simplest)scope.GetObjectById(objectId);
                    sum -= s.Id;
                }
                ts.Complete();
            }
            if (count <= InstanceCount)
            {
                Assert.AreEqual(0, sum);
            }
        }