fitSharp
With Keyword
The With keyword is one of the Flow Fixture Keywords. It sets the System Under Test for the current fixture.
Set the System Under Test to a new instance.

when input is
story test fixture
checkplain testwith new 'sample domain adapter'
set name Bob
check 'lower case name' bob
with new sample domain adapter
set name Bob
check lower case name bob
with new 'sample domain adapter'
set name Bob
check 'lower case name' bob
then output is
with new sample domain adapter
set name Bob
check lower case name bob

Set the System Under Test to a new instance with parameters.

when input is
story test fixture
checkplain testwith new 'sample domain' Bob
check name Bob
with new sample domain Bob
check name Bob
with new 'sample domain' Bob
check name Bob
then output is
with new sample domain Bob
check name Bob

Set the System Under Test to the result of a method.

when input is
story test fixture
checkplain test'sample domain adapter'
with 'make sample domain' Joe
check name Joe
sample domain adapter
with make sample domain Joe
check name Joe
'sample domain adapter'
with 'make sample domain' Joe
check name Joe
then output is
sample domain adapter
with make sample domain Joe
check name Joe

Set the System Under Test to a type.

when input is
story test fixture
checkplain testwith type 'sample domain'
check 'static method' hello
with type sample domain
check static method hello
with type 'sample domain'
check 'static method' hello
then output is
with type sample domain
check static method hello

Set the System Under Test to a named object.

when input is
story test fixture
checkplain testwith new 'sample domain' Joe
name joesname name
with joesname
check tolower joe
with new sample domain Joe
name joesname name
with joesname
check tolower joe
with new 'sample domain' Joe
name joesname name
with joesname
check tolower joe
then output is
with new sample domain Joe
name joesname name
with joesname
check tolower joe

The enclosing fixture must provide a method.

when input is
story test fixture
checkplain testuse column with 'my method'
use
Member 'mymethod' with 0 parameter(s) not found for type 'fitSharp.Fit.Engine.DefaultFlowInterpreter'.
column with my method
use column with 'my method'then output is
use
Member 'mymethod' with 0 parameter(s) not found for type 'fitSharp.Fit.Engine.DefaultFlowInterpreter'.
column with my method

Errors are reported if information is missing.

when input is
story test fixture
checkplain testwith

with new

with type
with
This table is invalid for this fixture: missing cells for with.

with
This table is invalid for this fixture: missing cells for new.
new

with
This table is invalid for this fixture: missing cells for with.
type
with

with new

with type
then output is
with
This table is invalid for this fixture: missing cells for with.

with
This table is invalid for this fixture: missing cells for new.
new

with
This table is invalid for this fixture: missing cells for with.
type
Copyright © 2022 Syterra Software Inc. All rights reserved.