fitSharp
Grid Fixture
Grid Fixture compares a two-dimensional array of objects to its table of expected values. The values are compared positionally; there is no header row with member names.

Matching cells are marked.

setup sample grid
012
abc
def

when test is
story test fixture
checktest result
sample grid
abc
def

sample grid
abc
def

sample grid
abc
def
then result is
sample grid
abc
def

Mismatched cells are reported.

when test is
story test fixture
checktest result
sample grid
abx
ddf

sample grid
abx expected
c actual
At 0 expected x was c
dd expected
e actual
At 0 expected d was e
f

sample grid
abx
ddf
then result is
sample grid
abx expected
c actual
At 0 expected x was c
dd expected
e actual
At 0 expected d was e
f

Missing and surplus rows are reported.

when test is
story test fixture
checktest result
sample grid
xyz
def

sample grid
x missingyz
def
a surplus b c

sample grid
xyz
def
then result is
sample grid
x missingyz
def
a surplus b c

An empty grid is matched.

setup sample grid
012

when test is
story test fixture
checktest result
sample grid

sample grid

sample grid
then result is
sample grid

Duplicate rows are handled.

setup sample grid
012
abc
dde
dde

when test is
story test fixture
checktest result
sample grid
abc
dde
dde

sample grid
abc
dde
dde

sample grid
abc
dde
dde
then result is
sample grid
abc
dde
dde
© Copyright Syterra Software Inc. All rights reserved.