c# - Dummy ObjectList generator for unit testing -


Can anyone also explain that there is a good framework in C # that will create dummy objects and lists so that we can Do not need to manually generate stub data?

You can try that its purpose is to produce a fast generation of test items.

If you have an employee class:

  public class employee {public string name {get; Set; } Public Date Time Birthday {Received; Set; }}   

Preparing a list of 10 employee items is as simple:

  var employee = builder & lt; Employee & gt; CREATEListOfSize (10) Build ();   

This will generate a unique incremental value for all areas of the object:

  name 1 7/12/2012 Name 2 7/13/2012 Name 3 7/14/2012 ...   

In addition, the NBuilder has a powerful powerful fluent interface, which allows custom value to be set for any generated object:

  var employee = builder & lt; Employee & gt ;; (E = & gt; E.Dress = Builder & lt; Address & gt; Garbage New) (.) With (E => E. name = "Sergey"). Build ()). Builder ();   

In addition to this, you can view it:



Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -