Comments (7)
@benjaminsampica Fair points. I'm not opposed to a Bogus wrapper. I'll take a look.
from soenneker.utils.autobogus.
@soenneker huge thanks for thanking this over and fixing some of the bugs (like DateOnly
issues).
Cosign on @benjaminsampica - it would be great to allow customization the way AutoBogus classic did
from soenneker.utils.autobogus.
@benjaminsampica @conradakunga OK I've implemented AutoFaker<T>
. I have some tests in place, but if you run into any issues with it please let me know. Thanks
from soenneker.utils.autobogus.
Can you expand on your example some? Was this supported in AutoBogus before?
I removed a bunch of extension methods from the autofakerconfigbuilder but I think the majority of it exists within the AutoFakerConfig...
I could definitely be wrong.
Happy to help solve any friction!
from soenneker.utils.autobogus.
Looking to do something like this (from AutoBogus). There was also Ignore(), which would skip a property.
var personFaker = new AutoFaker<Person>()
.RuleFor(fake => fake.Id, fake => fake.Random.Int())
.Generate();
If youβre familiar with AutoFixture at all, their convention is With() and Without()
from soenneker.utils.autobogus.
@soenneker I'm trying to use the new implemented AutoFaker<T>
with a static value for a property but it is throwing: Object reference not set to an instance of an object.
My implementation:
var test = new AutoFaker<Entity>()
.RuleFor(e => e.TypeA, nameof(EnumTypeA.Lorem))
.RuleFor(e => e.TypeB, nameof(EnumTypeB.Lorem))
.Generate(3);
from soenneker.utils.autobogus.
@marcio-af-oliveira can you send me the full exception message with the callstack? I just built several tests just like how you have your code there and have no issues.
from soenneker.utils.autobogus.
Related Issues (11)
- `AutoFakerOverrides` mentioned in the docs is not a class in this solution HOT 1
- How do you customise the response for entities with properties that are set by the constructor? HOT 1
- Drop in replacement? HOT 3
- Is there a way to always create an empty list instead of null HOT 7
- Please add a way to support internal properties/fields HOT 2
- Support abstract types
- (Performance idea) Code generation HOT 1
- Generate multiple creates nullable entries HOT 3
- Private readonly fields - are overwritten/generated automatically HOT 6
- Generate fake from proto (gRPC) - class causes a fatal error / crashes the whole test runner process HOT 4
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 soenneker.utils.autobogus.