Comments (11)
thanks to you your tool is GREAT!
from specflow.assist.dynamic.
Ah - good catch... It has to do with the way I'm converting it into values for the dynamic.
I have no quick way of testing this but now, but maybe you could surround it with quotes to ... force it to be treated as string, as a workaround
from specflow.assist.dynamic.
thanks for your quick reply do you mean in specflow like this | myfield2 |"01"| not sure what you mean.
Also is there a way to force all the fields to be considered as string ?
thanks
from specflow.assist.dynamic.
@developer9969, yes the quotes as you wrote it is a suggestion for a workaround to see if you can force it to be a string. Or if you can prefix it with a letter - just to "trick" my library into treating it as a string.
Here's a description of the convention based type convention I'm using, to assist you in your tricking of my library.
Sadly there is no way to force it to be a string - and since I've used a convention based conversion function from the outset we probably have to add a configuration property to be able to change that.
Something like
<specFlow.Assist.Dyamic>
<useConventionBaseTypeConversion>false</useConventionBaseTypeConversion>
</specFlow.Assist.Dyamic>
That means that if you set this value to false we will always just use strings. Otherwise, the default behaviour is to do the convention base type conversion as today.
@darrencauthon - what do you think? Would that be a good approach?
Sadly my Windows-time these day is ... seldom. Don't even have a virtual windows around anymore. If we like this approach I'll get around of making this happen.
from specflow.assist.dynamic.
@developer9969 now read my comment from late yesterday I see that it needs some more input.
As a workaround i mean that you can do _07
instead of 07
from specflow.assist.dynamic.
I've fixed this for you @developer9969
Read the documentation at https://github.com/marcusoftnet/SpecFlow.Assist.Dynamic/wiki/Conversion-conventions#disabling-type-conversion and get an updated version of SpecFlow.Assist.Dynamic from NuGet. 1.3.0 contains this fix.
Please let me know how it's working for you
from specflow.assist.dynamic.
Thanks for fixing this so promptly. It does work with your sample but not with mine try this
| Field |Value|
| myfield1 |02|
| myfield2 |01|
and see what you get ? Am I missing the obvious here
thanks again
from specflow.assist.dynamic.
Hmmm - sitting on a Mac again and I have no easy way to test this right now, but from the formatting above I'm thinking that maybe the |
needs spaces on the side?
If my examples work, how about modifying them little by little and see if you can understand what is different?
from specflow.assist.dynamic.
@developer9969 that is a bug! A missing case that I didn't account for.
Uploading 1.3.1 version of this tool to nuget as we speak.
The gist of it is that you can create an instance from a table with one row of header and values - like this:
Scenario: There's ways to disable type conversion for instance creation
When I create a dynamic instance from this table using no type conversion
| Name | Age | Birth date | Length in meters |
| 012345 | 044 | 1972-13-09 | 1,96 |
Then the Name value should still be '012345'
And the Age value should still be '044'
And the birth date should stil be '1972-13-09'
And length in meter should still be '1,96'
But your case is a special case, when there are two columns. Because that is interpreted by SpecFlow.Assist.Dynamic as a key/value table that will used like this:
Scenario: There's ways to disable type conversion for instance creation with key/value tables
When I create a dynamic instance from this table using no type conversion
| Key | Value |
| Name | 012345 |
| Age | 044 |
| Birth date | 1972-13-09 |
| Length in meters | 1,96 |
Then the Name value should still be '012345'
And the Age value should still be '044'
And the birth date should stil be '1972-13-09'
And length in meter should still be '1,96'
But I didn't handle the second case (key/value pairs) until now. Thanks for pointing that out.
SpecFlow.Assist.Dynamic 1.3.1 should fix this for you.
Thank you for making my little tool better!
from specflow.assist.dynamic.
Hi debugged the code and for some reason it always hits the 1st "if" statement cannot work out why it thinks more than 1 rowcount is the way i layout the data in the feature?
anyway I will play with it at the weekend .
from specflow.assist.dynamic.
Happy to hear that @developer9969 - does that mean that it works, reg your debugging above? '
Please close the issue if you feel like it solved.
from specflow.assist.dynamic.
Related Issues (16)
- Change to hintpath HOT 6
- Handling reserved characters in property names HOT 7
- Convert solution to Visual Studio 2015
- references mismatch HOT 2
- Indicate data type of values which are different in DynamicSetComparisonException.Differences
- CreateDynamicInstance from a table with a single Field and Value doesn't create the ExpandoObject as expected
- Ability to specify property name casing rules, or a way to match property names HOT 2
- `Property value type conversions` section in wiki needs to be updated with the correct order of operations
- Support .NET Core, .NET Standard #20 HOT 4
- How to create dynamic object with nested children? HOT 11
- Latest specflow versions are not supported
- table value is converting to date time by default HOT 1
- Forcing a particular datatype to be created HOT 6
- Add support for additional types, specified by user. HOT 13
- double.NaN is not equal to double.NaN
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from specflow.assist.dynamic.