GreenShell.NullChecker.Core
1.0.0
See the version list below for details.
dotnet add package GreenShell.NullChecker.Core --version 1.0.0
NuGet\Install-Package GreenShell.NullChecker.Core -Version 1.0.0
<PackageReference Include="GreenShell.NullChecker.Core" Version="1.0.0" />
<PackageVersion Include="GreenShell.NullChecker.Core" Version="1.0.0" />
<PackageReference Include="GreenShell.NullChecker.Core" />
paket add GreenShell.NullChecker.Core --version 1.0.0
#r "nuget: GreenShell.NullChecker.Core, 1.0.0"
#:package GreenShell.NullChecker.Core@1.0.0
#addin nuget:?package=GreenShell.NullChecker.Core&version=1.0.0
#tool nuget:?package=GreenShell.NullChecker.Core&version=1.0.0
NullChecker.Core
GreenShell.NullChecker is a lightweight, re-usable way to validate that a created class has all of it's properties set. Useful when unit testing factory methods, or any methods that involve the creation of complex objects no matter how simple or convoluted.
The Problem To Solve
When unit testing, an often overlooked test case is to verify that every property on an object is set. This leads to time wasted investigating what has gone wrong across your entire code base when the output from your UI has nulls inside a property that was supposed to be populated. NullChecker solves this by using reflection to read every property on a class and ensure that it is not null. This means that in the future, a unit test will fail if a new property is added but is not mapped correctly.
Usage
Using NullChecker is easy and uses a fluent interface to ensure a clean codebase throughout. A very basic check using NullChecker would be NullChecker.For(myObject).Validate()
Options
For Creates a NullChecker class, the entry point into nullcheckers functionality
NullChecker.For(MyObject)
Ignore Removes the property from the list of properties to validate against
NullChecker.For(myObject).Ignore(obj => obj.MyProperty).Validate()
AllowValueTypeValidation Validates value objects, ensures the validate method will return false if any value objects are set to their default value (if they are not explicitly ignored)
NullChecker.For(myObject).AllowValueTypeValidation().Validate()
Validate Validates against every property on the class that is not ignored. Returns true if nothing is null, false if anything is invalid.
NullChecker.For(myObject).Validate()
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Linq.Expressions (>= 4.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release for nuget consumption