LPRun 6.14.11

Install-Package LPRun -Version 6.14.11
dotnet add package LPRun --version 6.14.11
<PackageReference Include="LPRun" Version="6.14.11" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LPRun --version 6.14.11
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: LPRun, 6.14.11"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install LPRun as a Cake Addin
#addin nuget:?package=LPRun&version=6.14.11

// Install LPRun as a Cake Tool
#tool nuget:?package=LPRun&version=6.14.11
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Latest build NuGet Downloads License

LINQPad Driver LPRun Unit/Integration Tests Runner

Table of Contents


LINQPad driver LPRun unit/integration tests runner. Can be used for testing LINQPad 6 drivers using LPRun or for running LINQPad scripts.


LPRun is a part of CsvLINQPadDriver for LINQPad 6. LPRun source code can be found here.




Tested driver MUST NOT be installed via NuGet into LINQPad. In this case LPRun will use it instead of local one.


  1. Create test project.
  2. Add LPRun NuGet
  3. Create the following folder structure in test project:
LPRun # Created by LPRun NuGet.
    Templates # LINQPad script templates.
    Data      # Optional: Driver data files.

LINQPad Test Script Example

LPRun executes LINQPad test script. Test script uses Fluent Assertions for assertion checks.

StringComparison.linq LINQPad test script example:

var original = Books.First();
var copy = original with { Title = original.Title.ToUpper() };

var expectedEquality = original.Title.Equals(copy.Title, context.StringComparison);

original.Equals(copy).Should().Be(expectedEquality, Reason());

    .Be(expectedEquality, Reason());

Reason() method (prints exact line number if assertion fails) and context variable are injected by test below.

NUnit Test Example

Full NUnit test code can be found here.

public class LPRunTests
    public void Init() =>
        // Copy driver to LPRun drivers folder.

    public void Execute_ScriptWithDriverProperties_Success(
        (string linqScriptName,
         string? context,
         ICsvDataContextDriverProperties driverProperties) testData)
        var (linqScriptName, context, driverProperties) = testData;

        // Arrange: Create query connection header. Custom code can be added here.
        var queryConfig = GetQueryHeaders().Aggregate(
            new StringBuilder(),
            (stringBuilder, h) =>
            return stringBuilder;

        // Arrange: Create test LNQPad script.
        var linqScript = LinqScript.Create($"{linqScriptName}.linq", queryConfig);

        // Act: Execute test LNQPad script.
        var (output, error, exitCode) =
            Runner.Execute(linqScript, TimeSpan.FromMinutes(2));

        // Assert.

        // Helpers.
        IEnumerable<string> GetQueryHeaders()
            // Connection header.
            yield return ConnectionHeader.Get(

            // FluentAssertions helper.
            yield return
                @"string Reason([CallerLineNumber] int sourceLineNumber = 0) =>" +
                @" $""something went wrong at line #{sourceLineNumber}"";";

            // Test context.
            if (!string.IsNullOrWhiteSpace(context))
                yield return $"var context = {context};";

    private static IEnumerable<
        (string linqScriptName,
         string? context,
         ICsvDataContextDriverProperties driverProperties)> TestsData()
        // Omitted for brevity.

Known Issues

  • Tested with NUnit. Other test frameworks should work as well.


  • Ivan Ivon (ivan.ivon@gmail.com)





MIT, see LICENSE file for details.

  • .NETStandard 2.1

    • 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
6.14.11 129 9/1/2021
6.14.10 180 7/18/2021
6.13.14 164 5/10/2021
6.13.13 109 5/5/2021

LPRun 6.14.10
Added .NET 5.0 support.