예제 #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));
 }