fitSharp
With Keyword
The With keyword is one of the Flow Fixture Keywords. It sets the System Under Test for the current fixture.
story test fixture

Set the System Under Test to a new instance.

checktest result
do
withnewsample domain adapter
setnameBob
checklower case namebob

do
withnewsample domain adapter
setnameBob
checklower case namebob

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

checktest result
do
withnewsample domainBob
checknameBob

do
withnewsample domainBob
checknameBob

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

checktest result
do
withnewsample domain adapter
withmake sample domainJoe
checknameJoe

do
withnewsample domain adapter
withmake sample domainJoe
checknameJoe

Set the System Under Test to a type.

checktest result
do
withtypesample domain
checkstatic methodhello

do
withtypesample domain
checkstatic methodhello

Set the System Under Test to a named object.

checktest result
do
withnewsample domainJoe
namejoesnamename
withjoesname
checktolowerjoe

do
withnewsample domainJoe
namejoesnamename
withjoesname
checktolowerjoe

For named objects or methods, the enclosing fixture must be a flow fixture.

checktest result
usecolumnwithmy method

use
fitlibrary.exception.TableStructureException: This table is invalid for this fixture: flow fixture required.
columnwithmy method

Errors are reported if information is missing.

checktest result
do

with

withnew

withtype

do

with
fitlibrary.exception.TableStructureException: This table is invalid for this fixture: missing cells for with.

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

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