示例#1
0
        public void NotRemovedNegative()
        {
            var collection = EntityWithIdOfInt.Range(1, 10).ToArray();

            collection.AsQueryable().Get(1).MarkAsRemoved();

            Assert.IsNull(collection.AsQueryable().NotRemoved().GetOrNull(1));
        }
示例#2
0
        public void GetAnyOf_Partialy()
        {
            var array = EntityWithIdOfInt.Range(1, 10).GetAnyOf(1, 2, 300).ToArray();

            Assert.AreEqual(2, array.Length);
            Assert.IsNotNull(array.SingleOrDefault(s => s.Id == 1));
            Assert.IsNotNull(array.SingleOrDefault(s => s.Id == 2));
        }
示例#3
0
        public void GetAllOf_Positive()
        {
            var array = EntityWithIdOfInt.Range(1, 10).GetAllOf(1, 2, 3).ToArray();

            Assert.AreEqual(3, array.Length);
            Assert.IsNotNull(array.SingleOrDefault(s => s.Id == 1));
            Assert.IsNotNull(array.SingleOrDefault(s => s.Id == 2));
            Assert.IsNotNull(array.SingleOrDefault(s => s.Id == 3));
        }
示例#4
0
        EntityWithIdOfInt[] CreateTestArray()
        {
            var array = EntityWithIdOfInt.Range(1, 10).ToArray();

            for (int i = 0; i < 10; i++)
            {
                array[i].Created = new DateTime(1990, 01, i);
            }
            return(array);
        }
示例#5
0
 public void GetIntFail()
 {
     EntityWithIdOfInt.Range(1, 10).Get(100);
 }
示例#6
0
 public void GetInt()
 {
     Assert.AreEqual(2, EntityWithIdOfInt.Range(1, 10).Get(2).Id);
 }
示例#7
0
 public void GetAllOf_Negative()
 {
     EntityWithIdOfInt.Range(1, 10).GetAllOf(new int[0]);
 }
示例#8
0
 public void GetAllOf_Partialy()
 {
     var array = EntityWithIdOfInt.Range(1, 10).GetAllOf(1, 2, 300);
 }
示例#9
0
        public void GetAnyOf_Negative()
        {
            var array = EntityWithIdOfInt.Range(1, 10).GetAnyOf(100, 200, 300).ToArray();

            Assert.AreEqual(0, array.Length);
        }
示例#10
0
 public void GetIntOrNullFail()
 {
     Assert.IsNull(EntityWithIdOfInt.Range(1, 10).GetOrNull(100));
 }