Questions tagged [autobogus]

Use this tag for questions about Autobogus, a C# library complementing the Bogus generator by adding auto creation and population capabilities.

A library complementing the generator by adding auto creation and population capabilities.

3 questions
4
votes
1 answer

AutoBogus AutoFaker custom generator

Given the enumeration class with a private constructor, how can I configure AutoBogus.AutoFaker to use my custom strategy when generating such a class? In Example: public class CardType : Enumeration { public static CardType Amex = new(1,…
Raul
  • 2,745
  • 1
  • 23
  • 39
2
votes
1 answer

How to use AutoBogus/Bogus to generate a constant value for a property based on its type?

I'm trying to generate objects of a class whereby its value should reflect its type. For example, if its property's type is a string, then that property's value should be "string" and if it is an integer, it should be of a max integer value. So far,…
John Evans Solachuk
  • 1,953
  • 5
  • 31
  • 67
0
votes
1 answer

How to use AutoBogus to create fake object of class with constructor parameter?

I have a class say User with interface in constructor paramater. Could someone please help me how I can create fake object with mocked interface. Right now It is throwing an exception. Is there any way to override it?
vishal
  • 596
  • 2
  • 12
  • 31