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.
- name <symbol-name> <method> <parameters>
- name <symbol-name> with <with-phrase>
A fixture can be saved and then used.
when input is⇓
story test fixture |
check | plain 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 | name | savex | make sample do | xxx |
name | savey | make sample do | yyy |
|
| '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 | name | savex | make sample do | xxx |
name | savey | make sample do | yyy |
|
A domain object can be saved, and is wrapped in a Do fixture when used.
when input is⇓
story test fixture |
check | plain test | name savebob with new 'sample domain' Bob
use savebob
check name Bob | name | savebob | with | new | sample domain | Bob |
|
| name savebob with new 'sample domain' Bob
use savebob
check name Bob | then output is | name | savebob | with | new | sample domain | Bob |
|
Errors are reported when the method is invalid or cells are missing.
when input is⇓
story test fixture |
check | plain test | name 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 |
check | plain test | 'sample do'
name savebob with new 'sample domain' Bob
check 'get name' <<savebob Bob | 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 | name | savebob | with | new | sample domain | Bob |
check | get name | <<savebob fit.Test.Double.SampleDomain | Bob |
|