private bool Compare(long expected, long actual, DecimalComparison comparison)
        {
            switch (comparison)
            {
            case DecimalComparison.equal:
                return(expected == actual);

            case DecimalComparison.notEqual:
                return(expected != actual);

            case DecimalComparison.greaterThan:
                return(actual > expected);

            case DecimalComparison.greaterOrEqualThan:
                return(actual >= expected);

            case DecimalComparison.lowerThan:
                return(actual < expected);

            case DecimalComparison.lowerOrEqualThan:
                return(actual <= expected);

            default:
                return(false);
            }
        }
 public FetchedEventsSumTraceAssertAttribute(int EventId, Type TraceEventType, string PropertyName, long ExpectedSum, DecimalComparison comparison)
 {
     this.EventId        = EventId;
     this.ExpectedSum    = ExpectedSum;
     SumComparison       = comparison;
     this.TraceEventType = TraceEventType;
     this.PropertyName   = PropertyName;
 }
Esempio n. 3
0
 public FetchedEventsCountTraceAssertAttribute(int EventId, int Count, DecimalComparison comparison)
 {
     this.EventId    = EventId;
     this.Count      = Count;
     CountComparison = comparison;
 }
Esempio n. 4
0
 public FetchedEventsCountTraceAssertAttribute(string EventName, int Count, DecimalComparison comparison)
 {
     this.EventName  = EventName;
     this.Count      = Count;
     CountComparison = comparison;
 }