Tasty Class

Summary

The global Tasty Scope.
Namespace
Xenial
Base Types
  • object
graph BT Type-->Base0["object"] Type["Tasty"] class Type type-node

Syntax

public static class Tasty

Examples

using static Xenial.Tasty;
    
     Describe("Basic math:", () => 
     {
         It("1 + 1 = 2", () => 1 + 2 == 3);
    
         It("1 - 1 = 0", () =>
         {
             var sub = 1 - 1var result = sub == 0;
             return result;
         });
     });
     
     Run();

Properties

Name Value Summary
TastyDefaultScope TastyScope
static

Methods

Name Value Summary
AfterEach(Action) void
Add a callback that runs after each TestCase and each TestGroup in this scope
static
AfterEach(Func<Task>) void
Add a callback that runs after each TestCase and each TestGroup in this scope
static
BeforeEach(Action) void
Add a callback that runs before each TestCase and each TestGroup in this scope
static
BeforeEach(Func<Task>) void
Add a callback that runs before each TestCase and each TestGroup in this scope
static
Describe(string, Action) TestGroup
Adds a describe block eg. TestGroup to the current scope
static
Describe(string, Func<Task>) TestGroup
Adds a describe block eg. TestGroup to the current scope
static
FDescribe(string, Action) TestGroup
Adds a describe block eg. TestGroup to the current scope and mark all nested TestGroups and TestCases as forced/focused
static
FDescribe(string, Func<Task>) TestGroup
Adds a describe block eg. TestGroup to the current scope and mark all nested TestGroups and TestCases as forced/focused
static
FIt(string, Action) TestCase
Adds a TestCase to the current scope and mark it as forced/focused
static
FIt(string, Func<(bool result, string message)>) TestCase
Adds a TestCase to the current scope and mark it as forced/focused Return true if the test is succeeded, otherwise false Return an additional message that will be reported if the test is failed
static
FIt(string, Func<bool>) TestCase
Adds a TestCase to the current scope and mark it as forced/focused Return true if the test is succeeded otherwise false
static
FIt(string, Func<Task<(bool result, string message)>>) TestCase
Adds a TestCase to the current scope and mark it as forced/focused Return true if the test is succeeded, otherwise false Return an additional message that will be reported if the test is failed
static
FIt(string, Func<Task<bool>>) TestCase
Adds a TestCase to the current scope and mark it as forced/focused Return true if the test is succeeded otherwise false
static
FIt(string, Func<Task>) TestCase
Adds a TestCase to the current scope and mark it as forced/focused
static
It(string, Action) TestCase
Adds a TestCase to the current scope
static
It(string, Executable) TestCase
Adds a TestCase to the current scope Return true if the test is succeeded otherwise falseS
static
It(string, Func<(bool success, string message)>) TestCase
Adds a TestCase to the current scope Return true if the test is succeeded, otherwise false Return an additional message that will be reported if the test is failed
static
It(string, Func<bool>) TestCase
Adds a TestCase to the current scope
static
It(string, Func<IAsyncEnumerable<TestCaseResult>>) TestCase
Adds a TestCase to the current scope
static
It(string, Func<Task<(bool success, string message)>>) TestCase
Adds a TestCase to the current scope Return true if the test is succeeded, otherwise false Return an additional message that will be reported if the test is failed
static
It(string, Func<Task>) TestCase
Adds a TestCase to the current scope
static
RegisterReporter(AsyncTestReporter) TastyScope
Registers an async test reporter. Gets called immediate after the test was executed AsyncTestReporter
static
RegisterReporter(AsyncTestSummaryReporter) TastyScope
Registers an async test summary reporter. Gets called after all tests are executed. AsyncTestSummaryReporter
static
Report(TestCaseResult) Task
Reports the specified test to the configured test reporters.
static
Run() Task<int>
Runs the tests in the global scope. Returns an non zero exit code if all tests succeed
static
Run(string[]) Task<int>
Runs the tests in the global scope. Returns an non zero exit code if all tests succeed
static