/// <summary> /// Handles an invalidation. /// </summary> /// <param name="keys">The invalidated keys.</param> /// <param name="sourceClusterClientIds">The identifiers of the cluster client originating the event.</param> /// <param name="partitionUuids"></param> /// <param name="sequences">The sequences.</param> public void Handle(IEnumerable <IData> keys, IEnumerable <Guid> sourceClusterClientIds, IEnumerable <Guid> partitionUuids, IEnumerable <long> sequences) { foreach (var(key, sourceClusterClientId, partitionUuid, sequence) in EnumerableExtensions.Combine(keys, sourceClusterClientIds, partitionUuids, sequences)) { Handle(key, sourceClusterClientId, partitionUuid, sequence); } }
public void ArgumentExceptions() { var items = Array.Empty <int>(); Assert.Throws <ArgumentNullException>(() => _ = EnumerableExtensions.Combine(items, items, items, (int[])null).ToArray()); Assert.Throws <ArgumentNullException>(() => _ = EnumerableExtensions.Combine(items, items, (int[])null, items).ToArray()); Assert.Throws <ArgumentNullException>(() => _ = EnumerableExtensions.Combine(items, (int[])null, items, items).ToArray()); Assert.Throws <ArgumentNullException>(() => _ = EnumerableExtensions.Combine((int[])null, items, items, items).ToArray()); }
public void CombineToIntArrays() { var ints1 = new[] { 1, 2, 3 }; var ints2 = new[] { 4, 5 }; var ints3 = new[] { 5, 6, 7, 8 }; var result = EnumerableExtensions.Combine(ints1, ints2, ints3); Assert.AreEqual(24, result.Length); result = new[] { ints1, ints2, ints3 }.Combine(); Assert.AreEqual(24, result.Length); result = new[] { ints1 }.Combine(); Assert.AreEqual(3, result.Length); }
public void Combine() { var items1 = new[] { 1, 2, 3 }; var items2 = new[] { "a", "b", "c" }; var items3 = new[] { 4, 5, 6 }; var items4 = new[] { 'x', 'y', 'z', 't' }; var items = EnumerableExtensions.Combine(items1, items2, items3, items4).ToArray(); Assert.That(items.Length, Is.EqualTo(3)); Assert.That(items[0], Is.EqualTo((1, "a", 4, 'x'))); Assert.That(items[1], Is.EqualTo((2, "b", 5, 'y'))); Assert.That(items[2], Is.EqualTo((3, "c", 6, 'z'))); }