GreenShell.NullChecker.Core 1.0.0

There is a newer version of this package available.
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
                    
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="GreenShell.NullChecker.Core" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GreenShell.NullChecker.Core" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="GreenShell.NullChecker.Core" />
                    
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 GreenShell.NullChecker.Core --version 1.0.0
                    
#r "nuget: GreenShell.NullChecker.Core, 1.0.0"
                    
#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 GreenShell.NullChecker.Core@1.0.0
                    
#: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=GreenShell.NullChecker.Core&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=GreenShell.NullChecker.Core&version=1.0.0
                    
Install as a Cake Tool

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 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. 
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
2.0.0 724 1/18/2020
1.0.0 651 1/18/2020

Initial release for nuget consumption