Example #1
0
        public void has_event_type()
        {
            var mapping = new StreamMapping(typeof(Quest));
            mapping.HasEventType(typeof(MembersJoined)).ShouldBeFalse();

            mapping.AddEvent(typeof (MembersJoined));

            mapping.HasEventType(typeof(MembersJoined)).ShouldBeTrue();

        }
Example #2
0
        public EventMapping(StreamMapping parent, Type eventType) : base(eventType)
        {
            if (!eventType.CanBeCastTo<IEvent>())
                throw new ArgumentOutOfRangeException(nameof(eventType),
                    $"Only types implementing {typeof (IEvent)} can be accepted");

            Stream = parent;

            EventTypeName = ToEventTypeName(eventType);
        }
Example #3
0
        public EventMapping(StreamMapping parent, Type eventType) : base(eventType)
        {
            if (!eventType.CanBeCastTo <IEvent>())
            {
                throw new ArgumentOutOfRangeException(nameof(eventType),
                                                      $"Only types implementing {typeof (IEvent)} can be accepted");
            }

            Stream = parent;

            EventTypeName = ToEventTypeName(eventType);
        }