Assert.Kind.Message.Condition 1.0.9

dotnet add package Assert.Kind.Message.Condition --version 1.0.9                
NuGet\Install-Package Assert.Kind.Message.Condition -Version 1.0.9                
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="Assert.Kind.Message.Condition" Version="1.0.9" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Assert.Kind.Message.Condition --version 1.0.9                
#r "nuget: Assert.Kind.Message.Condition, 1.0.9"                
#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.
// Install Assert.Kind.Message.Condition as a Cake Addin
#addin nuget:?package=Assert.Kind.Message.Condition&version=1.0.9

// Install Assert.Kind.Message.Condition as a Cake Tool
#tool nuget:?package=Assert.Kind.Message.Condition&version=1.0.9                

Overview

The assertion library with a very convenient method chaining api (aka fluent interface).

Reference

public static class Assert {
    public static class Argument {
        public static Assertions.Argument Message(FormattableString? value);
    }
    public static class Operation {
        public static Assertions.Operation Message(FormattableString? value);
    }
}
public static class Assertions {
    public readonly struct Argument {
        public void Valid(bool isValid);
        public void NotNull(bool isValid);
        public void InRange(bool isValid);
    }
    public readonly struct Operation {
        public void Valid(bool isValid);
        public void Ready(bool isValid);
        public void NotDisposed(bool isValid);
    }
}
public static class Exceptions {
    public static class Argument {
        public static ArgumentException ArgumentException(FormattableString? message);
        public static ArgumentNullException ArgumentNullException(FormattableString? message);
        public static ArgumentOutOfRangeException ArgumentOutOfRangeException(FormattableString? message);
    }
    public static class Operation {
        public static InvalidOperationException InvalidOperationException(FormattableString? message);
        public static ObjectNotReadyException ObjectNotReadyException(FormattableString? message);
        public static ObjectDisposedException ObjectDisposedException(FormattableString? message);
    }
    public static class Internal {
        public static Exception Exception(FormattableString? message);
        public static NullReferenceException NullReference(FormattableString? message);
        public static NotSupportedException NotSupported(FormattableString? message);
        public static NotImplementedException NotImplemented(FormattableString? message);
    }
}

Example

// Assert.Argument
Assert.Argument.Message( $"ArgumentException" ).Valid( ... )
Assert.Argument.Message( $"ArgumentNullException" ).NotNull( ... )
Assert.Argument.Message( $"ArgumentOutOfRangeException" ).InRange( ... )
// Assert.Operation
Assert.Operation.Message( $"InvalidOperationException" ).Valid( ... )
Assert.Operation.Message( $"ObjectNotReadyException" ).Ready( ... )
Assert.Operation.Message( $"ObjectDisposedException" ).NotDisposed( ... )

// Exceptions.Argument
throw Exceptions.Argument.ArgumentException( $"ArgumentException" )
throw Exceptions.Argument.ArgumentNullException( $"ArgumentNullException" )
throw Exceptions.Argument.ArgumentOutOfRangeException( $"ArgumentOutOfRangeException" )
// Exceptions.Operation
throw Exceptions.Operation.InvalidOperationException( $"InvalidOperationException" )
throw Exceptions.Operation.ObjectNotReadyException( $"ObjectNotReadyException" )
throw Exceptions.Operation.ObjectDisposedException( $"ObjectDisposedException" )
// Exceptions.Internal
throw Exceptions.Internal.Exception( $"Exception" )
throw Exceptions.Internal.NullReference( $"NullReferenceException" )
throw Exceptions.Internal.NotSupported( $"NotSupportedException" )
throw Exceptions.Internal.NotImplemented( $"NotImplementedException" )

P.S.

Note that it is preferable to check the arguments first, and then everything else. This is because other checks may depend on the validity of the your arguments.

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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Assert.Kind.Message.Condition:

Package Downloads
HierarchicalTreeMachine

The library that helps you implement a tree structure.

StateMachine.Pro

The library that helps you implement a stateful object.

TreeMachine.Pro

The library that helps you implement a tree structure.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.9 169 11/14/2024
1.0.8 81 11/5/2024
1.0.7 136 11/4/2024
1.0.6 535 6/7/2024
1.0.5 95 5/23/2024
1.0.3 103 5/9/2024
1.0.2 63 5/2/2024
1.0.1 63 5/2/2024
1.0.0 61 5/2/2024