fitSharp
System Under Test
To validate the behavior of a system under test, we need to create instances of objects in the system, execute methods on those objects and check that the expected behavior has occurs. There are a variety of patterns to perform this validation with fitSharp.

Every storytest has a test-level System Under Test. This object can be set with the With Keyword. When we use a custom flow fixture to control Flow Mode, we can also set this test-level System Under Test in our fixture code.

Some fixtures have a fixture-level System Under Test property, which contains the object used by the fixture. This property may be set in our fixture code with SetSystemUnderTest(myObject) and often can be supplied to the fixture constructor.

Some fixtures are created automatically by fitSharp when a result is returned by a method in Flow Mode. This result is used as the System Under Test for the automatically-created fixture.

Whenever a fixture is created, if the test-level System Under Test has been set and the new fixture has a SetSystemUnderTest method, the test-level object is passed to the new fixture.

The Use Fixture can also be used to create a new fixture and supply it with a System Under Test.

When we create a flow fixture in the body of a storytest that is already in Flow Mode, this fixture has a fixture-level System Under Test.

Some fixtures, like Compute Fixture, do not have a System Under Test property and always use the fixture that creates them as a Domain Adapter.

when input is
story test fixture
checkplain testwith new 'sample domain' Bob

|compute
name
Bob

|do
with new 'sample domain' Sue
compute
name
Sue
with new sample domain Bob

compute
name
Bob

do
with new sample domain Sue
compute
name
Sue
with new 'sample domain' Bob

|compute
name
Bob

|do
with new 'sample domain' Sue
compute
name
Sue
then output is
with new sample domain Bob

compute
name
Bob

do
with new sample domain Sue
compute
name
Sue

Every object used by fixtures can be an instance of the system under test, or it can be a Domain Adapter.

Multiple objects can be saved and re-used as Symbol Values.
© Copyright Syterra Software Inc. All rights reserved.