CsUnitTestHelper 0.0.12
dotnet add package CsUnitTestHelper --version 0.0.12
NuGet\Install-Package CsUnitTestHelper -Version 0.0.12
<PackageReference Include="CsUnitTestHelper" Version="0.0.12" />
<PackageVersion Include="CsUnitTestHelper" Version="0.0.12" />
<PackageReference Include="CsUnitTestHelper" />
paket add CsUnitTestHelper --version 0.0.12
#r "nuget: CsUnitTestHelper, 0.0.12"
#:package CsUnitTestHelper@0.0.12
#addin nuget:?package=CsUnitTestHelper&version=0.0.12
#tool nuget:?package=CsUnitTestHelper&version=0.0.12
Unit test helper for C#
int GenerateRandomInt()
Creates a random integer between 1 and 9
int GenerateRandomInt(int min, int max)
Creates a random integer between min and max
string GenerateRandomString()
Creates a random string with chars from A-z with 10 chars
string GenerateRandomString(int numberOfCharacters)
Creates a random string with chars from A-z with passed numberOfCharacters
List<T> GenerateRandomList<T>(Func<T> Generator, int numberOfElements)
Creates a random list of given type with elements from the generator
bool GenerateRandomBool()
Creates a random bool
DateTime GetGenerateRandomDateTime()
Creates a random DateTime between 1870 and 2300
string GenerateRandomStringGuidWithPrefix(string prefix)
Returns a GUID as string with the given prefix
string ToRandomCase(this string text)
Returns the passed string in random case
TempCreateDirectory(string path)
Creates a directory and deletes it, when disposed
TempCreateFile(string path, string content)
Creates a file and deletes it, when disposed
TempCreateFileInFolder(string path, string content)
Creates a file in a folder and deletes both, when disposed
TempSetEnvVar(string var, string value)
Sets a env variable to value and sets it back to the value before, when disposed
TempSetAppSetting(string key, string value)
Sets a AppSetting to value and sets it back to initial state, when disposed
TempDeleteFile(string filePath)
Removes a file temporarily and restores it, when disposed
static bool IsInBetween(this int value, int min, int max)
Checks if value is in between of min and max and logs message to console, if not
static bool HasAttribute<T>(this T _, Type attribute) where T : class
Returns true, if a class contains the attribute. Otherwise false.
static bool HasPropertyWithAttribute<T>(this T _, string propertyName, Type attribute)
Retruns ture if a property of a class contains the attribute. If the property does not exist, or the property does not contains the attribute, it return false.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. 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. 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 was computed. 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. |
-
net7.0
- ClassExtensions (>= 0.0.4)
- System.Configuration.ConfigurationManager (>= 7.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.