All Downloads are FREE. Search and download functionalities are using the official Maven repository.

FitNesseRoot.Fitnesse.UserGuide.FixtureGallery.ImportantConcepts.FixtureArguments.content.txt Maven / Gradle / Ivy

There is a newer version: 4.4
Show newest version

''Next page: [[!-Flow Mode-!][ set=new HashSet();
		for(String s: args){
			for (String word: s.split(" ")) set.add(new Word(word));
		}
		this.setActualCollection(set);
		super.doTable(arg0);
	}
}
}}}
# section .NET Source Code
!3 !-.NET Source Code-!
{{{
using System;
using System.Collections.Generic;
using System.Text;

namespace info.fitnesse.fixturegallery
{

    public class ArgumentsTest: fit.RowFixture
    {
        public override Type GetTargetClass()
        {
            return typeof(Text);
        }
        public override object[] Query()
        {
            List t = new List();
            foreach (String s in Args)
            {
                foreach (String w in s.Split(new char[] { ' ' }))
                {
                    t.Add(new Text(w));
                }

            }
            return t.ToArray();
        }
    }
}
}}}
# section Python Source Code
!3 !-Python Source Code-!
{{{
# REQUIRE: Python >= 2.4, due to set() usage

from fitLib.SetFixture import SetFixture
import types

class Word(object):
    """Simple ValueObject class to store a word as string."""
    _typeDict = { "word": "String" }

    def __init__(self, word):
        assert isinstance(word, types.StringTypes)
        self.word = word

class ArgumentsTest(SetFixture):

    def getTargetClass(self):
        return Word #< CLASS-HINT: For _typeDict lookup.

    def doTable(self, table):
        wordSet = set()
        for s in self.args:
            for word in s.split(" "):
                wordSet.add( Word(word) )
        # -- WEIRD: setActualCollection() takes no arg -> Preassign first.
        self.paramCollection = wordSet
        self.setActualCollection()
        SetFixture.doTable(self, table)
}}}
!- Note that arguments are just plain strings. Symbols do not work automatically with arguments, so trying to pass -!'''!- <




© 2015 - 2025 Weber Informatics LLC | Privacy Policy