CsUnitTestHelper 0.0.12

dotnet add package CsUnitTestHelper --version 0.0.12
                    
NuGet\Install-Package CsUnitTestHelper -Version 0.0.12
                    
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="CsUnitTestHelper" Version="0.0.12" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CsUnitTestHelper" Version="0.0.12" />
                    
Directory.Packages.props
<PackageReference Include="CsUnitTestHelper" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CsUnitTestHelper --version 0.0.12
                    
#r "nuget: CsUnitTestHelper, 0.0.12"
                    
#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.
#:package CsUnitTestHelper@0.0.12
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CsUnitTestHelper&version=0.0.12
                    
Install as a Cake Addin
#tool nuget:?package=CsUnitTestHelper&version=0.0.12
                    
Install as a Cake Tool

.NET Core Desktop CodeQL Codacy Security Scan SecurityCodeScan

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.12 372 3/3/2023
0.0.11 386 1/27/2023
0.0.10 350 1/27/2023
0.0.9 329 1/27/2023
0.0.8 313 1/26/2023
0.0.7 358 12/28/2022
0.0.6 354 12/28/2022
0.0.5 380 12/27/2022
0.0.4 383 12/13/2022
0.0.3 359 12/13/2022
0.0.2 462 12/3/2022
0.0.1 398 12/2/2022