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(); }
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); }
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); }