MiniSpec Syntax
// Simple tests may simply return a Boolean:
bool TestAnotherThing => 1 == 2;
// Developers may optionally include our Expect() method.
using static MiniSpec.Expect;
// Expect() can be used with simple one-line tests:
bool TestMoreThings => Expect(Foo).ToEqual("Bar");
// Or define full methods (Note: using a class is optional)
void MyTest() {
Expect(TheAnswer).ToEqual(42);
}
// Support for setup and teardown functionality
void SetUp() { /* do something */ }
void TearDown() { /* do something */ }
// Tests may also be grouped within a class
class MyTests {
bool PassingTest => true;
// Or even grouped within a method
static void Group() {
bool LocalTestFunction() => Expect("This Syntax").To.Work.OK;
}
}
Writing a Red Test Choosing a Style to Implement