Trace: » fixturegallery » fixturearguments » plain_selenium_test_reference » help » constraintfixture
Table of Contents
The Fixture Gallery is also available as a PDF document and a live FitNesse wiki. See http://gojko.net/fitnesse/fixturegallery for more information.
Previous page: CombinationFixture Next page: SetFixture Parent page: FitLibrary Fixtures
ConstraintFixture
ConstraintFixture is a variation of CalculateFixture (see CalculateFixture) that has an expected value of true for each calculation.
Table Format
The first row of the table is the fixture class name. After that, the second row contains names for input parameters. All rows after that specify values for the input parameters.
!|ConstraintFixtureTest| |firstPart|secondPart| |1|2| |2|3|
Fixture class
The fixture class should extend fitlibrary.ConstraintFixture. It should declare a boolean method with a name concatenated from all parameter names (in this case firstPartSecondPart).
Java Source Code
package info.fitnesse.fixturegallery;
import fitlibrary.ConstraintFixture;
public class ConstraintFixtureTest extends ConstraintFixture{
public boolean firstPartSecondPart(int firstPart,int secondPart){
return firstPart<secondPart;
}
}
.NET Source Code
using fitlibrary;
using System;
namespace info.fitnesse.fixturegallery
{
public class ConstraintFixtureTest: ConstraintFixture
{
public bool FirstPartSecondPart(int firstPart,int secondPart)
{
return firstPart<secondPart;
}
}
}
Python Source Code
# PYTHON: info.fitnesse.fixturegallery.CombinationFixtureTest
from fitLib.ConstraintFixture import ConstraintFixture
class ConstraintFixtureTest(ConstraintFixture):
_typeDict = {}
# PY3K: firstPartSecondPart(firstPart : int, secondPart : int) : bool
_typeDict["firstPartSecondPart.types"] = [ "Boolean", "Int", "Int" ]
def firstPartSecondPart(self, firstPart, secondPart):
return firstPart < secondPart
Smalltalk Source Code
'From VisualWorks®, 7.6 of March 3, 2008 on June 27, 2008 at 3:36:32 pm'!
Info.Fitnesse.Fixturegallery defineClass: #ConstraintFixtureTest
superclass: #{Fitlibrary.ConstraintFixture}
indexedType: #none
private: false
instanceVariableNames: ''
classInstanceVariableNames: ''
imports: ''
category: ''!
!Info.Fitnesse.Fixturegallery.ConstraintFixtureTest methodsFor: 'accessing'!
firstPart: aInteger secondPart: bInteger
^aInteger < bInteger! !
!Info.Fitnesse.Fixturegallery.ConstraintFixtureTest methodsFor: 'type access'!
signatureFor: aSymbol
^MethodSignature with: Integer with: Integer returning: Boolean! !
Previous page: CombinationFixture Next page: SetFixture Parent page: FitLibrary Fixtures
