Exceptionless.RandomData
2.0.1
Prefix Reserved
dotnet add package Exceptionless.RandomData --version 2.0.1
NuGet\Install-Package Exceptionless.RandomData -Version 2.0.1
<PackageReference Include="Exceptionless.RandomData" Version="2.0.1" />
<PackageVersion Include="Exceptionless.RandomData" Version="2.0.1" />
<PackageReference Include="Exceptionless.RandomData" />
paket add Exceptionless.RandomData --version 2.0.1
#r "nuget: Exceptionless.RandomData, 2.0.1"
#:package Exceptionless.RandomData@2.0.1
#addin nuget:?package=Exceptionless.RandomData&version=2.0.1
#tool nuget:?package=Exceptionless.RandomData&version=2.0.1
Exceptionless.RandomData
A utility library for generating random data in .NET. Makes generating realistic test data a breeze. Targets net8.0 and net10.0.
Getting Started
This package can be installed via the NuGet package manager. If you need help, please contact us via in-app support or open an issue. We're always here to help if you have any questions!
dotnet add package Exceptionless.RandomData
Usage
All methods are on the static RandomData class in the Exceptionless namespace.
Numbers
using Exceptionless;
int value = RandomData.GetInt(1, 100);
long big = RandomData.GetLong(0, 1_000_000);
double d = RandomData.GetDouble(0.0, 1.0);
decimal m = RandomData.GetDecimal(1, 500);
Booleans
using Exceptionless;
bool coin = RandomData.GetBool();
bool likely = RandomData.GetBool(chance: 80); // 80% chance of true
Strings
using Exceptionless;
string random = RandomData.GetString(minLength: 5, maxLength: 20);
string alpha = RandomData.GetAlphaString(10, 10);
string alphaNum = RandomData.GetAlphaNumericString(8, 16);
Words, Sentences, and Paragraphs
using Exceptionless;
string word = RandomData.GetWord();
string title = RandomData.GetTitleWords(minWords: 3, maxWords: 6);
string sentence = RandomData.GetSentence(minWords: 5, maxWords: 15);
string text = RandomData.GetParagraphs(count: 2, minSentences: 3, maxSentences: 10);
string html = RandomData.GetParagraphs(count: 2, html: true);
Dates and Times
using Exceptionless;
DateTime date = RandomData.GetDateTime();
DateTime recent = RandomData.GetDateTime(start: DateTime.UtcNow.AddDays(-30), end: DateTime.UtcNow);
DateTimeOffset dto = RandomData.GetDateTimeOffset();
TimeSpan span = RandomData.GetTimeSpan(min: TimeSpan.FromMinutes(1), max: TimeSpan.FromHours(2));
Enums
using Exceptionless;
DayOfWeek day = RandomData.GetEnum<DayOfWeek>();
Network and Versioning
using Exceptionless;
string ip = RandomData.GetIp4Address(); // e.g. "192.168.4.12"
string coord = RandomData.GetCoordinate(); // e.g. "45.123,-90.456"
string version = RandomData.GetVersion("1.0", "5.0");
Pick Random from Collection
The Random<T>() extension method picks a random element from any IEnumerable<T>:
using Exceptionless;
int[] numbers = [1, 2, 3, 4, 5];
int picked = numbers.Random();
string[] names = ["Alice", "Bob", "Charlie"];
string? name = names.Random();
Thanks to all the people who have contributed
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Exceptionless.RandomData:
| Package | Downloads |
|---|---|
|
Foundatio.TestHarness
Pluggable foundation blocks for building distributed apps. |
GitHub repositories (5)
Showing the top 5 popular GitHub repositories that depend on Exceptionless.RandomData:
| Repository | Stars |
|---|---|
|
Megabit/Blazorise
Blazorise is a component library built on top of Blazor with support for CSS frameworks like Bootstrap, Tailwind, Bulma, AntDesign, and Material.
|
|
|
exceptionless/Exceptionless
Exceptionless application
|
|
|
FoundatioFx/Foundatio
Pluggable foundation blocks for building distributed apps.
|
|
|
exceptionless/Exceptionless.Net
Exceptionless clients for the .NET platform
|
|
|
FoundatioFx/Foundatio.Redis
Foundatio Redis
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.1 | 0 | 2/24/2026 |
| 2.0.0 | 54 | 2/20/2026 |
| 1.2.2 | 55,984 | 1/2/2023 |
| 1.2.1 | 16,046 | 3/14/2022 |
| 1.2.0 | 25,155 | 2/6/2020 |
| 1.1.47 | 118,703 | 8/16/2017 |
| 1.1.45 | 4,878 | 8/16/2017 |
| 1.1.43 | 4,894 | 8/16/2017 |
| 1.1.41 | 4,876 | 8/16/2017 |
| 1.1.35 | 8,671 | 5/5/2017 |
| 1.1.33 | 4,913 | 5/5/2017 |
| 1.1.27 | 9,147 | 12/22/2016 |
| 1.1.26 | 6,594 | 9/23/2016 |
| 1.1.25 | 5,167 | 9/23/2016 |
| 1.1.24 | 7,062 | 6/28/2016 |
| 1.1.23 | 5,234 | 6/5/2016 |
| 1.0.22 | 6,200 | 4/18/2016 |
| 1.0.21 | 5,979 | 2/22/2016 |
| 1.0.20 | 5,430 | 2/22/2016 |
| 1.0.19 | 5,309 | 2/16/2016 |