pauldeen79.System.Data.Stub 3.0.1

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

// Install pauldeen79.System.Data.Stub as a Cake Tool
#tool nuget:?package=pauldeen79.System.Data.Stub&version=3.0.1                

CrossCutting

Generic utilities and other stuff, usable in any layer of any solution. We're targeting .NET Standard 2.0, so you can even use .NET Framework 4.x if you want to.

This repository consists of the following packages:

Package name Description
CrossCutting.Common Provider for system date and user name, some useful extension methods on System.Object and System.String, and the Result class
CrossCutting.Common.Testing Helps you test constructors on null checks
CrossCutting.Data.Abstractions Abstraction for executing database commands using System.Data namespace (IDbConnection and IDbCommand)
CrossCutting.Data.Core Default implementation of database commands
CrossCutting.Data.Sql Extension methods for working with database commands in System.Data namespace (IDbConnection)
CrossCutting.DataTableDumper Produces flat-text data tables from objects
CrossCutting.Utilities.ObjectDumper Produces readable flat-text representation from objects, for use in logging
CrossCutting.Utilities.Parsers Parser for pipe-delmited data table strings, TSQL INSERT INTO statements, function strings, math expressions and formattable strings (dynamic interpolated strings)
System.Data.Stub Stubs for System.Data interfaces like IDbConnection, IDbCommand and IDataReader

Using NSubstitute or Moq as mock factory for CrossCutting.Common.Testing

To use NSubstitute as a mock factory for the code in CrossCutting.Common.Testing, create a test helper project within your solution, and add the following code:

    public static void ShouldThrowArgumentNullExceptionsInConstructorsOnNullArguments(
        this Type type,
        Func<ParameterInfo, bool>? parameterPredicate = null,
        Func<ParameterInfo, object?>? parameterReplaceDelegate = null,
        Func<ConstructorInfo, bool>? constructorPredicate = null)
        => ShouldThrowArgumentNullExceptionsInConstructorsOnNullArguments(
            type,
            t => t.CreateInstance(parameterType => Substitute.For(new[] { parameterType }, Array.Empty<object>()), parameterReplaceDelegate, constructorPredicate),
            parameterPredicate,
            parameterReplaceDelegate,
            constructorPredicate);

You can easily replace NSubstitute with Moq, if you want, by changing the factory delegate argument to this:

t => t.CreateInstance(parameterType => ((Mock)Activator.CreateInstance(typeof(Mock<>).MakeGenericType(parameterType))).Object, parameterReplaceDelegate, constructorPredicate),

Upgrade from 2.x to 3.0

There has been a breaking change in the Result class, which lead to a new major version. To port the old code, you can fix most errors by replace this:

Result<([^>]+)>\.([^(]+)\(

With this:

Result.$2<$1>(
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 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.
  • .NETStandard 2.0

    • No dependencies.

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
3.0.1 338 5/3/2024
3.0.0 138 4/24/2024
2.10.0 281 9/13/2023
2.9.0 184 9/9/2023
2.8.0 161 9/9/2023
2.7.59 174 9/8/2023
2.7.58 161 9/6/2023
2.7.57 147 8/31/2023
2.7.56 186 8/30/2023
2.7.55 161 5/15/2023
2.7.54 220 5/15/2023
2.7.53 201 5/8/2023
2.7.52 206 5/6/2023
2.7.51 173 5/5/2023
2.7.50 189 5/2/2023
2.7.49 166 5/2/2023
2.7.48 160 5/2/2023
2.7.47 190 5/2/2023
2.7.46 187 5/2/2023
2.7.45 194 5/2/2023
2.7.44 178 5/2/2023
2.7.43 185 5/2/2023
2.7.42 208 5/1/2023
2.7.41 208 5/1/2023
2.7.40 255 4/28/2023
2.7.39 233 4/27/2023
2.7.38 198 4/27/2023
2.7.37 220 4/26/2023
2.7.36 222 4/24/2023
2.7.35 233 4/22/2023
2.7.34 235 4/20/2023
2.7.33 237 4/17/2023
2.7.32 228 4/17/2023
2.7.31 210 4/16/2023
2.7.30 217 4/10/2023
2.7.29 230 4/10/2023
2.7.28 235 4/9/2023
2.7.27 252 4/9/2023
2.7.26 247 4/7/2023
2.7.25 495 10/14/2022
2.7.24 446 10/14/2022
2.7.23 460 9/20/2022
2.7.22 475 8/28/2022
2.7.21 435 8/26/2022
2.7.20 438 8/26/2022
2.7.19 441 8/24/2022
2.7.18 426 8/15/2022
2.7.17 457 7/1/2022
2.7.16 452 6/30/2022
2.7.15 463 6/29/2022
2.7.14 451 6/29/2022
2.7.13 492 6/26/2022
2.7.12 484 6/24/2022
2.7.11 450 6/24/2022
2.7.10 463 6/17/2022
2.7.9 447 6/16/2022
2.7.8 452 6/8/2022
2.7.7 476 5/27/2022
2.7.6 564 2/27/2022
2.7.5 506 2/24/2022
2.7.4 522 1/31/2022
2.7.3 370 12/22/2021
2.7.2 367 12/18/2021
2.7.1 343 12/17/2021
2.7.0 354 12/16/2021
2.6.2 582 12/9/2021
2.6.1 387 11/30/2021
2.6.0 375 11/28/2021
2.5.3 349 11/27/2021
2.5.2 2,111 11/26/2021
2.5.0 2,332 11/26/2021
2.4.2 3,339 11/25/2021
2.4.1 2,701 11/25/2021
2.4.0 337 11/23/2021
2.3.0 354 11/22/2021
2.2.5 1,231 11/20/2021
2.2.4 831 11/19/2021
2.2.3 414 11/18/2021
2.2.2 393 11/18/2021
2.2.1 352 11/17/2021
2.2.0 331 11/14/2021
2.1.1 433 11/7/2021
2.1.0 393 11/1/2021
2.0.3 386 10/31/2021
2.0.2 417 10/31/2021
2.0.1 438 10/31/2021
2.0.0 411 10/31/2021
1.2.1 480 10/30/2021
1.2.0 429 10/27/2021
1.1.0 431 9/17/2021
1.0.12 374 9/16/2021
1.0.11 433 4/29/2021
1.0.10 370 4/27/2021
1.0.9 404 4/27/2021
1.0.8 400 4/11/2021
1.0.7 356 4/10/2021
1.0.6 386 4/10/2021
1.0.5 434 4/2/2021
1.0.4 417 3/30/2021
1.0.3 394 3/30/2021
1.0.1 421 3/30/2021