six2six / fixture-factory

Generator fake objects from a template
Apache License 2.0
445 stars 88 forks source link

Make RandomFunction work with primitive types #99

Closed humblehacker closed 5 years ago

humblehacker commented 7 years ago

My data objects use primitive types for numeric fields. When I attempted to use random(long.class, range(1L, 200L)) to populate one of these fields, fixture-factory failed with an exception (RandomFunction.generateValue() would return null, which can't be assigned to a primitive type).

codecov-io commented 7 years ago

Codecov Report

Merging #99 into master will increase coverage by 0.23%. The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master     #99      +/-   ##
===========================================
+ Coverage     84.67%   84.9%   +0.23%     
- Complexity      347     356       +9     
===========================================
  Files            41      41              
  Lines           868     868              
  Branches        148     148              
===========================================
+ Hits            735     737       +2     
  Misses           92      92              
+ Partials         41      39       -2
Impacted Files Coverage Δ Complexity Δ
...x/fixturefactory/function/impl/RandomFunction.java 88.33% <100%> (ø) 32 <0> (+7) :arrow_up:
...six/fixturefactory/function/impl/CnpjFunction.java 95.45% <0%> (ø) 5% <0%> (ø) :arrow_down:
...m/six2six/fixturefactory/util/ReflectionUtils.java 72.27% <0%> (+1.98%) 37% <0%> (+2%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ccd3905...4f3b66d. Read the comment docs.