Thanks for the video! really useful, i have a question, i am generating countrys whith name and CountryCode ISO 33166. All the 245 that exist, but as it is randomly generated, repeted countrys apear. how can i avoid repeted country names and country codes using The faker (Address.Country and Address.CountryCode) ?
Bogus, to me, is used for generating real looking data that I need to read. Something I would use to seed my Local/QA/Test database(es) and then display in a UI. AutoFixture I've used in unit tests where I wanted complex objects but don't necessarily need properties to be readable. Example, for property Firstname, Bogus would create a string of "Sally", "Kevin" or "Nick". Whereas AutoFixture would create a string of "Firstname_9b003ae7-f6e6-45c8-836a-e8d1c4d6c403', 'Firstname_3f739a19-8b61-4214-b628-2cae4cb6f31d', or 'Firstname_dea11d42-9cff-44b3-94e2-5192c09eb110'. My unit test for Firstname just cares that its a string, not necessarily the contents of the property.
I wonder if you can use it to fake 2 objects that are related. For example, you have entity & dto class and you want to fake both with same data, then I can test a mapper logic to make sure the return dto has the correct mappings.
In this case you need to populate one object, then map it manually to the other object and compare this with what your mapper returns. Or, maybe you want to test your mapper, but there is other way to map these objects which you can trust. For example serialize one object to json and deserialize as another object. Then again you populate one object and compare your mapper with this method.
@@izobrr what I meant is using the faker instead of doing it manually. Almost: var objectToMap = new faker(); var mappedDto = mapper(objectToMap); var expected = new faker(); mappedDto.shouldBeEquivalentTo(expected);
I like your channel and topics for .net. this is also an interesting one!
Your videos and content is invaluable. Thanks
Thanks for this - very apropos for me! Never heard of this package until now! Thanks!
Great video, this would help me to test simple apis on net core.
What about Autofixture?
How to quickly populate in Visual Studio 2022 like 5:50 ?
Hey, is there a way to have coherent address like not having an American Lake in the Country Reunion for example?
Thanks for the video! really useful, i have a question, i am generating countrys whith name and CountryCode ISO 33166. All the 245 that exist, but as it is randomly generated, repeted countrys apear. how can i avoid repeted country names and country codes using The faker (Address.Country and Address.CountryCode) ?
Thanks. Great one
Thanks for video.
What's the comparison between Bogus and GenFu. GenFu pretty much does the same
Hi Nick I haven’t watched the video yet but do you know how this compares with Autofixture which I use?
If you want realistic looking data then it’s better
Bogus, to me, is used for generating real looking data that I need to read. Something I would use to seed my Local/QA/Test database(es) and then display in a UI.
AutoFixture I've used in unit tests where I wanted complex objects but don't necessarily need properties to be readable.
Example, for property Firstname, Bogus would create a string of "Sally", "Kevin" or "Nick". Whereas AutoFixture would create a string of "Firstname_9b003ae7-f6e6-45c8-836a-e8d1c4d6c403', 'Firstname_3f739a19-8b61-4214-b628-2cae4cb6f31d', or 'Firstname_dea11d42-9cff-44b3-94e2-5192c09eb110'.
My unit test for Firstname just cares that its a string, not necessarily the contents of the property.
Nice one, thanks!
can you please talk about background services in dotnet core?
Thank you Thank you!!
Interesting, thank you! :)
Good share. Thanks
I wonder if you can use it to fake 2 objects that are related. For example, you have entity & dto class and you want to fake both with same data, then I can test a mapper logic to make sure the return dto has the correct mappings.
In this case you need to populate one object, then map it manually to the other object and compare this with what your mapper returns. Or, maybe you want to test your mapper, but there is other way to map these objects which you can trust. For example serialize one object to json and deserialize as another object. Then again you populate one object and compare your mapper with this method.
@@izobrr what I meant is using the faker instead of doing it manually. Almost: var objectToMap = new faker(); var mappedDto = mapper(objectToMap); var expected = new faker(); mappedDto.shouldBeEquivalentTo(expected);
think you
Bravo Poly😀
It would be cool if it could generate the values automatically. Maybe I should write something like that 🤔
This is cool!
Super!
I love bogus!