Hi Jonas,
Thanks for your reply, I wasn't aware of the
StepArgumentTransformation feature. While this is a great feature it
doesn't solve the problem entirely for us.
It solves the problem with step arguments of primitive types. But
since the CurrentCulture remains english we still experience problems:
- When using tables as step arguments, where we do custom parsing of
values.
- With formatting done in the system under test
We have currently solved the problem by introducing parsing- and
formatting helper classes that apply a specific culture to all
operations of that kind and use these in both steps and system under
test. Combined with the feature you mentioned everything is good
again.
I do think it is a great feature of SpecFlow to actually use a
specific culture when executing the tests since the feature files are
obviously written in a specifc format. But I would probably prefer to
have the option to configure culture and Gherkin language
independently. Maybe as an optional configuration value that would
explicitly state the culture to be set as CurrentCulture.
Thanks again,
Martin
On 1 Jul., 10:55, Jonas Bandi <
jonas.ba...@gmail.com> wrote:
> Since SpecFlow 1.3 we are using the culture of the feature files to do
> the conversions (numbers, dates ...).
>
> To use a different culture for your formatting than for the feature
> language you can use the [StepArgumentTransformation] feature.
> It is a bit of work: you have to define a StepArgumentTransformation
> method for each type you want to convert.
> But you only have to do that once and you can even put those steps
> into its own library to reuse it across projects.
>
> I have put an example onto SpecFlow-Examples to demonstrate what I
> just described:
>
>
http://github.com/techtalk/SpecFlow-Examples/tree/master/features/Spe...
>
> Please tell us if this works for you.
>
> -jonas
>
> On Wed, Jun 30, 2010 at 5:02 PM, mgilden <
mar...@gildenpfennig.dk> wrote:
> > I'm trying to upgrade to SpecFlow 1.3.2 but I have run in to a problem
> > with the way languages are handled.
>
> > All our feature files are written in the english language, since this
> > is the language of our domain, but all values such as decimals, dates
> > and so on are all formatted according to danish culture info. With the
> > new release of SpecFlow we seem to be bound to either translate the
> > feature files to danish or explicitly tell all formatting methods to
> > use danish culture. Is there any other way to have english Gherkin
> > keywords while stille having the current culture info be danish?
>
> > Thanks,
> > Martin
>
> --
> mail:
jonas.ba...@gmail.com