fitSharp
Name Keyword
The Name keyword is one of the Flow Fixture Keywords. It assigns an object to a symbol name, which can be used to retrieve the object later with the Use Fixture, With Keyword or Symbol Values operators.
A fixture can be saved and then used.

when input is
story test fixture
checkplain test'sample do'
name savex 'make sample do' xxx
name savey 'make sample do' yyy

use savey
check text yyy

use savex
check text xxx
sample do
name savex make sample do xxx
name savey make sample do yyy

use savey
check text yyy

use savex
check text xxx
'sample do'
name savex 'make sample do' xxx
name savey 'make sample do' yyy

use savey
check text yyy

use savex
check text xxx
then output is
sample do
name savex make sample do xxx
name savey make sample do yyy

use savey
check text yyy

use savex
check text xxx

A domain object can be saved, and is wrapped in a Do fixture when used.

when input is
story test fixture
checkplain testname savebob with new 'sample domain' Bob

use savebob
check name Bob
name savebob with new sample domain Bob

use savebob
check name Bob
name savebob with new 'sample domain' Bob

use savebob
check name Bob
then output is
name savebob with new sample domain Bob

use savebob
check name Bob

Errors are reported when the method is invalid or cells are missing.

when input is
story test fixture
checkplain testname stuff garbage

name stuff

name
name
Member 'garbage' with 0 parameter(s) not found for type 'fitSharp.Fit.Engine.DefaultFlowInterpreter'.
stuff garbage

name
This table is invalid for this fixture: missing cells for name.
stuff

name
This table is invalid for this fixture: missing cells for name.
name stuff garbage

name stuff

name
then output is
name
Member 'garbage' with 0 parameter(s) not found for type 'fitSharp.Fit.Engine.DefaultFlowInterpreter'.
stuff garbage

name
This table is invalid for this fixture: missing cells for name.
stuff

name
This table is invalid for this fixture: missing cells for name.

Objects are assigned to symbols.

when input is
story test fixture
checkplain test'sample do'
name savebob with new 'sample domain' Bob
check 'get name' <<savebob Bob
sample do
name savebob with new sample domain Bob
check get name <<savebob fit.Test.Double.SampleDomain Bob
'sample do'
name savebob with new 'sample domain' Bob
check 'get name' <<savebob Bob
then output is
sample do
name savebob with new sample domain Bob
check get name <<savebob fit.Test.Double.SampleDomain Bob

© Copyright Syterra Software Inc. All rights reserved.