public void Aggregates_The_State_To_The_Worst_Case(LogItem.State firstState, LogItem.State secondState, LogItem.State expectedState) { var aggregate = new AggregateLogItem(new LogItem() { AccumulatedState = firstState }); aggregate.AddItem(new LogItem() { AccumulatedState = secondState }); aggregate.AccumulatedState.Should().Be(expectedState); }
public static Color GetColor(LogItem.State state) { switch (state) { case LogItem.State.Information: return(Color.SkyBlue); case LogItem.State.Warning: return(Color.Orange); case LogItem.State.Error: return(Color.Red); default: return(Color.Gray); } }
private void SetRowAnnotations(DevExpress.XtraGrid.Views.Grid.GridCustomScrollAnnotationsEventArgs e, LogItem.State state, Color color) { var errorDatasourceIndexes = _aggregatedLogs .Where(l => l.AccumulatedState == state) .Select(l => _aggregatedLogs.IndexOf(l)) .ToArray(); var errorRowHandles = errorDatasourceIndexes .Select(i => viewLog.GetRowHandle(i)) .Select(h => new DevExpress.XtraGrid.Views.Grid.GridScrollAnnotationInfo() { Color = color, RowHandle = h }) .ToArray(); e.Annotations.AddRange(errorRowHandles); }