Beispiel #1
0
        public void SparseSlotsFallback()
        {
            var deferred1 = new TestDeferred();
            var deferred2 = new TestDeferred(deferred1);

            deferred1.TestSlots = new TestSlots(0, 10, i => i % 2 == 0);
            deferred2.TestSlots = new TestSlots(0, 10, i => i % 2 == 1, setByMerge: true);

            Assert.AreEqual(10, deferred2.TestSlots.GlobalSlotsMask.Count, "Global Slots Mask");
            Assert.AreEqual(10, deferred2.TestSlots.Slots.Count(s => s != null), "Not Null Slots");
        }
Beispiel #2
0
        public void NullSlotsDoNotFallback()
        {
            var deferred1 = new TestDeferred();
            var deferred2 = new TestDeferred(deferred1);

            deferred1.TestSlots = new TestSlots(0, 10, i => i % 2 == 0);
            deferred2.TestSlots = new TestSlots(0, 10, i => i % 2 == 1);

            Assert.AreEqual(10, deferred2.TestSlots.GlobalSlotsMask.Count, "Global Slots Mask");
            Assert.AreEqual(10, deferred2.TestSlots.Slots.Count(), "Set Slots");
            Assert.AreEqual(5, deferred2.TestSlots.Slots.Count(s => s != null), "Not Null Slots");
        }