반응형
블로그 이미지
개발자로서 현장에서 일하면서 새로 접하는 기술들이나 알게된 정보 등을 정리하기 위한 블로그입니다. 운 좋게 미국에서 큰 회사들의 프로젝트에서 컬설턴트로 일하고 있어서 새로운 기술들을 접할 기회가 많이 있습니다. 미국의 IT 프로젝트에서 사용되는 툴들에 대해 많은 분들과 정보를 공유하고 싶습니다.
솔웅

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함

카테고리


반응형

ConstraintFixture



ConstraintFixtureCalculateFixtre의 변형 입니다. (see CalculateFixture) 이 ConstraintFixture는 각 calculation에 대한 true 값을 기대합니다.



Table Format



테이블의 첫번째 row는 fixture class 이름입니다. 그 다음 두번째 row에는 input parameter의 이름이 들어갑니다. 그 다음에 오는 모든 줄에는 input parameter의 값들을 넣구요.


!|ConstraintFixtureTest|
|firstPart|secondPart|
|1|2|
|2|3|





Fixture class

이 fixture class는 fitlibrary.ConstraintFixture를 extend 합니다. 여기에는 모든 파라미터 이름들로부터 나온 boolean method를 정의해야 합니다. (아래 예제의 경우에는 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      


       


SetFixture




SetFixture는 한가지만 빼고는 ArrayFixture와 같습니다. (see ArrayFixture) 다른점은 row의 순서가 체크되지 않는다는 겁니다.



Notes



자바 flow mode 에서는 flow fixture method에서 return 된 set들이 자동적으로 SetFixture에 매핑됩니다.


Usage



자바에서는 JavaBean object를 사용할 때 RowFixture 대신에 SetFixture를 사용하세요. 왜냐하면 이 fixture가 JavaBeans getter에 대해 정확하게 기능을 제공하거든요. element들의 순서가 그렇게 중요하지 않을 때는 이 SetFixtureArrayFixture 대신에 사용하셔도 됩니다.



SubsetFixture



SubsetFixtureSetFixture의 변형입니다. (see SetFixture)  fixture table에 있는 row가 실제 row들의 subset이 될 수 있다는 부분 만 다릅니다.



Usage


잔여 element들을 무시하기를 원하신다면 RowFixtureSetFixture 대신에 이 SubsetFixture를 사용하세요. (예를 들어 같은 데이터베이스 테이블안에 있는 다른 row들은 상관하지 않고 데이터베이스의 어떤 row들의 존재를 체크하고 싶은 경우 등을 들 수 있습니다.)

반응형