Пример #1
0
        public override ExpectationResult Verify(TBase value, IValueFormattingService formattingService)
        {
            if (value == null || value is TDerived)
            {
                return(_expectation.Verify((TDerived)value, formattingService));
            }

            return(ExpectationResult.Failure($"value of type '{value.GetType().Name}' cannot be cast to '{typeof(TDerived).Name}'"));
        }
Пример #2
0
 private ExpectationResult VerifyExpectation(VerifiableTableColumn column, ColumnValue expected, ColumnValue actual)
 {
     if (expected.HasValue && !actual.HasValue)
     {
         return(ExpectationResult.Failure("missing value"));
     }
     if (!expected.HasValue && actual.HasValue)
     {
         return(ExpectationResult.Failure("unexpected value"));
     }
     return(column.Expectation.Invoke(expected.Value).Verify(actual.Value, FormattingService));
 }