Unit

Test & Suite Lifecycle

Under Construction

This page is under construction and may contain incomplete or incorrect information.

Functional Approach to Tests

Developers familiar with existing testing frameworks like XUnit and NUnit will notice some key differences:

  • The familiar Assert has been replaced by new Fact() or a collection of Shouldly style assertion helpers
  • Test methods return Fact in the case of single synchronous test result and Task<Fact> when the single result is asynchronous

ZeUnit borrows a lot from functional programming, and requires that functions return results. In our case the Fact object which can have 0 or more assertions like Equal or Type in the code example above. Labeling the test function with a resulting type as defined in the table below allows you to define the execution timeline of your test(s) and how the Fact object(s) is/are being returned.

Test ResultsOneMany
NowFactIEnumerable<Fact>
LaterTask<Fact>IObservable<Fact>

Next Section: Reporting