public void ShouldSortAggregationOperationsAccordingPriority() { var comparer = new AggregateOperationPriorityComparer(); var data = new AggregateOperation[] { new DestroyAggregate(typeof(object), 0), new InitializeAggregate(typeof(object), 0), new RecalculateAggregate(typeof(object), 0), }; var sortedData = data.OrderByDescending(x => x.GetType(), comparer).ToArray(); Assert.That(sortedData[0], Is.InstanceOf <DestroyAggregate>()); Assert.That(sortedData[1], Is.InstanceOf <InitializeAggregate>()); Assert.That(sortedData[2], Is.InstanceOf <RecalculateAggregate>()); }
public void ShouldSortAggregationOperationsAccordingPriority() { var comparer = new AggregateOperationPriorityComparer(); var data = new AggregateOperation[] { new DestroyAggregate(typeof(object), 0), new InitializeAggregate(typeof(object), 0), new RecalculateAggregate(typeof(object), 0), }; var sortedData = data.OrderByDescending(x => x.GetType(), comparer).ToArray(); Assert.That(sortedData[0], Is.InstanceOf<DestroyAggregate>()); Assert.That(sortedData[1], Is.InstanceOf<InitializeAggregate>()); Assert.That(sortedData[2], Is.InstanceOf<RecalculateAggregate>()); }