/// <summary> /// Create a new <see cref="RedisPubSubCacheMessage{TKey}"/>. /// </summary> /// <param name="action"> /// The <see cref="RedisPubSubCacheMessageAction"/>. /// </param> /// <param name="keys"> /// The keys of the cache entries affected, if any. This cannot be null. /// </param> /// <exception cref="ArgumentNullException"> /// <paramref name="keys"/> cannot be null. /// </exception> public RedisPubSubCacheMessage(RedisPubSubCacheMessageAction action, params TKey[] keys) { if (keys == null) { throw new ArgumentNullException("keys"); } Action = action; Keys = keys; }
/// <summary> /// Create a new <see cref="RedisPubSubCacheMessage{TKey}"/>. /// </summary> /// <param name="action"> /// The <see cref="RedisPubSubCacheMessageAction"/>. /// </param> /// <param name="keys"> /// The keys of the cache entries affected, if any. This cannot be null. /// </param> /// <exception cref="ArgumentNullException"> /// <paramref name="keys"/> cannot be null. /// </exception> public RedisPubSubCacheMessage(RedisPubSubCacheMessageAction action, IEnumerable <TKey> keys) { if (keys == null) { throw new ArgumentNullException("keys"); } Action = action; Keys = keys.ToArray(); }
public void Ctor() { RedisPubSubCacheMessage <int> message; const RedisPubSubCacheMessageAction action = RedisPubSubCacheMessageAction.Remove; int[] keys = new[] { 1, 2 }; message = new RedisPubSubCacheMessage <int>(action, keys); Assert.That(message, Has.Property("Action").EqualTo(action)); Assert.That(message, Has.Property("Keys").EqualTo(keys)); }