public void Do_X_ReturnExpected_ToY_OnSameDate(UniverseStateEvent xe, UniverseStateEvent ye, int expected)
        {
            var eventDate = DateTime.UtcNow;
            var x         = new UniverseEvent(xe, eventDate, new object());
            var y         = new UniverseEvent(ye, eventDate, new object());

            var comparer = new UniverseEventComparer();

            var result = comparer.Compare(x, y);

            Assert.AreEqual(result, expected);
        }
Exemple #2
0
 /// <summary>
 /// The is order type.
 /// </summary>
 /// <param name="universeEvents">
 /// The universe events.
 /// </param>
 /// <returns>
 /// The <see cref="bool"/>.
 /// </returns>
 public static bool IsOrderType(this UniverseStateEvent universeEvents)
 {
     return(universeEvents == UniverseStateEvent.Order ||
            universeEvents == UniverseStateEvent.OrderFilled ||
            universeEvents == UniverseStateEvent.OrderPlaced);
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UniverseEvent"/> class.
 /// </summary>
 /// <param name="eventType">
 /// The event type.
 /// </param>
 /// <param name="eventTime">
 /// The event time.
 /// </param>
 /// <param name="underlyingEvent">
 /// The underlying event.
 /// </param>
 public UniverseEvent(UniverseStateEvent eventType, DateTime eventTime, object underlyingEvent)
 {
     this.StateChange     = eventType;
     this.UnderlyingEvent = underlyingEvent ?? throw new ArgumentNullException(nameof(underlyingEvent));
     this.EventTime       = eventTime;
 }