Class EventExtensions
Extension methods for IEvent and IEventSourced that are useful when testing.
Inherited Members
Namespace: IRM.Domain.Tests
Assembly: IRM.dll
Syntax
public static class EventExtensions
Methods
CountOfProducedEventsIs(IEventSourced, Int32)
Gets if an expected count of events has been produced.
Declaration
public static bool CountOfProducedEventsIs(this IEventSourced aggregate, int count)
Parameters
IEventSourced
aggregate
The IEventSourced object. |
System.Int32
count
The expected number of events. |
Returns
Boolean
true if the expected number of events has been produced; otherwise false. |
CountOfProducedEventsIs(IEnumerable<IEvent>, Int32)
Gets if an expected count of events has been produced.
Declaration
public static bool CountOfProducedEventsIs(this IEnumerable<IEvent> events, int count)
Parameters
IEnumerable<IEvent>
events
The collection of events to search in. |
System.Int32
count
The expected number of events. |
Returns
Boolean
true if the expected number of events has been produced; otherwise false. |
GetProducedEvents(IEventSourced)
Gets all newly produced events from an object.
Declaration
public static IEnumerable<IEvent> GetProducedEvents(this IEventSourced aggregate)
Parameters
IEventSourced
aggregate
The object to get newly produced events from. |
Returns
IEnumerable<IEvent>
A collection of IEvent that has been produced for the object. |
HasProducedEvent<T>(IEventSourced)
Gets if an IEvent have been produced by the aggregate.
Declaration
public static bool HasProducedEvent<T>(this IEventSourced aggregate)
where T : IEvent
Parameters
IEventSourced
aggregate
The IEventSourced object. |
Returns
Boolean
true if any event of |
Type Parameters
T
The IEvent to test for. |
HasProducedEvent<T>(IEnumerable<IEvent>)
Gets if an IEvent exists in the collection.
Declaration
public static bool HasProducedEvent<T>(this IEnumerable<IEvent> events)
where T : IEvent
Parameters
IEnumerable<IEvent>
events
The collection of events to search in. |
Returns
Boolean
true if any event of |
Type Parameters
T
The IEvent to test for. |