Skip to content
Cyrille DUPUYDAUBY edited this page Feb 14, 2019 · 15 revisions

V 2.5.0 (beta/in progress)

Main feature

  • CaptureConsole class mocks the system console. Using it you can inject/simulate user input (with Input and InputLine methods) and read/review what the code has put on the console (with the Output property). The class is disposable: nnormal behavior is restored on Dispose. Example

    using (var console = new CaptureConsole)
    {
        console.InputLine("12+13");
        // the code I need to check (a calculator here)
        Calculator.Process();
        // perform the check
        Check.That(console.Output).IsEqualTo("25");
     }
    

New checks

  • Console related checks (see above)

Improvements

  • Stabilize Assembly Version to reduce friction induced by strong naming (assembly version is still V2.4.0)
  • Align to Microsoft guidelines for OSS libraries (https://docs.microsoft.com/en-us/dotnet/standard/library-guidance/)
  • HasAvalue() and HasNoValue() are available on all nullable types
  • Add support for WithCustomMessage for dynamics.
  • Revised signature for enumerable checks to reduce type erasure (loss of type information when chaining checks). Regression tests have been added regarding non generic IEnumerable support, but as the changes are significant, please revert to us if you face issues.
  • Fixes reporting of end of line markers: only carriage return chars were reported.
  • Changed error text for missing or extra lines in string to make it clearer.
  • IsEqualTo provides more details for IEnumerable (make sure first different item is visible).
  • Number of items in expected value was often not reported in error messages.

Fixes

  • Fix false positive with TimeSpan due linked to precision loss. It concerns: IsEqualTo(TimeSpan), IsLessThan(TimeSpan), IsGreaterThan(TimeSpan)
  • Fix random FileNotFound exceptions on the first failing assertion while using XUnit in some specific setup.
  • Error message for Check.ThatCode().LastsLessThan did not report the actual time.
  • Error message for Not.ThrowsAny() was wrong.
  • Hashtable not properly reported in error messages.
  • Fixed error messages for negated checks on dynamics.
  • Fix false positive for IsNotZero (and IsZero) for decimal that are close to 0 (<.5).

GitHub Issues

  • #269, #274, #270, #275, #276, #280, #283, #184, #284, #286

Clone this wiki locally