public static bool Matches(string stream, string target)
        {
            var specs = StreamSubscriptionSpecification.From(type, type.Implementation);

            var matched = specs
                          .Select(s => s.Match(null, stream))
                          .Where(m => m != StreamSubscriptionMatch.None)
                          .ToArray();

            return(matched.Any(x => x.Target == target));
        }
Ejemplo n.º 2
0
        public static bool Matches(string stream, string target)
        {
            var actor = ActorType.From(typeof(T));
            var proto = ActorPrototype.Define(actor);
            var specs = StreamSubscriptionSpecification.From(actor, proto);

            var matched = specs
                          .Select(s => s.Match(null, stream))
                          .Where(m => m != StreamSubscriptionMatch.None)
                          .ToArray();

            return(matched.Any(x => x.Target == target));
        }
Ejemplo n.º 3
0
 public void Checking_target_matches_specification(string stream, string target, bool result)
 {
     Assert.That(StreamSubscriptionSpecification <Subscriber> .Matches(stream, target),
                 Is.EqualTo(result));
 }