RandomObjectCreator 0.0.1-beta.2
This is a prerelease version of RandomObjectCreator.
dotnet add package RandomObjectCreator --version 0.0.1-beta.2
NuGet\Install-Package RandomObjectCreator -Version 0.0.1-beta.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RandomObjectCreator" Version="0.0.1-beta.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RandomObjectCreator --version 0.0.1-beta.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: RandomObjectCreator, 0.0.1-beta.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install RandomObjectCreator as a Cake Addin #addin nuget:?package=RandomObjectCreator&version=0.0.1-beta.2&prerelease // Install RandomObjectCreator as a Cake Tool #tool nuget:?package=RandomObjectCreator&version=0.0.1-beta.2&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
RandomObjectCreator
C# helper util to mock objects with random data.
Examples
// class declaration for the following examples
class TestEntity
{
public double doubleProp { get; set; }
public string stringProp { get; set; }
public DateTime dateTimeProp { get; set; }
public TestEntity2 objectProp { get; set; }
public List<TestEntity2> listProp { get; set; }
public ICollection<TestEntity2> iCollectionProp { get; set; }
public IEnumerable<TestEntity2> iEnumerableProp { get; set; }
}
class TestEntity2
{
public double doubleProp2 { get; set; }
public string stringProp2 { get; set; }
public DateTime dateTimeProp2 { get; set; }
}
Populate an object with random data
var createdObject = RandomObjectCreator.Create<TestEntity>();
Populate an object with random data but skip certain types
var createdObject = RandomObjectCreator.Create<TestEntity>(null, new List<Type> { typeof(string) });
// createdObject.stringProp will be null
Populate an object with random data but skip certain properties with specific name
var createdObject = RandomObjectCreator.Create<TestEntity>(new List<string> { "dateTimeProp" });
// createdObject.dateTimeProp will be null
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.0.1-beta.2 | 158 | 10/24/2022 |
0.0.1-beta.1 | 104 | 10/23/2022 |