LPRun 6.14.10

There is a newer version of this package available.
See the version list below for details.
dotnet add package LPRun --version 6.14.10
NuGet\Install-Package LPRun -Version 6.14.10
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="LPRun" Version="6.14.10" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LPRun --version 6.14.10
#r "nuget: LPRun, 6.14.10"
#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 LPRun as a Cake Addin
#addin nuget:?package=LPRun&version=6.14.10

// Install LPRun as a Cake Tool
#tool nuget:?package=LPRun&version=6.14.10

Latest build NuGet Downloads License

LINQPad Driver LPRun Unit/Integration Tests Runner

Table of Contents

Description

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

Website

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

Download

NuGet

Usage

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

Setup

  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());

original.GetHashCode()
    .Equals(copy.GetHashCode())
    .Should()
    .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.

[TestFixture]
public class LPRunTests
{
    [OneTimeSetUp]
    public void Init() =>
        // Copy driver to LPRun drivers folder.
        Driver.Install("CsvLINQPadDriver",
            "CsvLINQPadDriver.dll",
            "CsvHelper.dll",
            "Humanizer.dll"
        );

    [Test]
    [TestCaseSource(nameof(TestsData))]
    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) =>
        {
            stringBuilder.AppendLine(h);
            stringBuilder.AppendLine();
            return stringBuilder;
        }).ToString();

        // 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.
        error.Should().BeNullOrWhiteSpace();
        exitCode.Should().Be(0);

        // Helpers.
        IEnumerable<string> GetQueryHeaders()
        {
            // Connection header.
            yield return ConnectionHeader.Get(
                "CsvLINQPadDriver",
                "CsvLINQPadDriver.CsvDataContextDriver",
                driverProperties,
                "System.Runtime.CompilerServices");

            // 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.

Authors

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

Credits

Tools

NuGet

License

MIT, see LICENSE file for details.

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

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
8.3.7 104 4/18/2024
8.3.6 171 4/14/2024
8.3.5 168 4/7/2024
8.3.3 144 3/21/2024
8.3.2 187 3/13/2024
8.3.1 125 3/12/2024
8.2.4 108 2/17/2024
8.2.3 112 2/13/2024
8.2.2 145 1/23/2024
8.1.6 107 1/17/2024
8.1.3 185 1/3/2024
8.1.2 177 12/27/2023
8.1.1 143 12/22/2023
8.0.18 212 12/5/2023
8.0.17 172 11/26/2023
8.0.16 181 11/25/2023
8.0.15 149 11/24/2023
8.0.14 145 11/22/2023
8.0.13 152 11/18/2023
8.0.12 155 11/17/2023
8.0.11 108 11/16/2023
8.0.10 175 11/15/2023
8.0.9 167 11/12/2023
7.8.10 105 2/14/2024
7.8.7 193 11/26/2023
7.8.6 312 9/14/2023
7.8.5 362 8/1/2023
7.8.4 282 7/13/2023
7.8.3 260 7/3/2023
7.8.2 267 6/16/2023
7.8.1 265 6/9/2023
7.7.15 252 5/31/2023
7.7.14 252 5/29/2023
7.7.13 247 5/23/2023
7.7.12 270 5/18/2023
7.7.11 301 5/10/2023
7.7.10 373 4/19/2023
7.7.9 372 4/4/2023
7.7.8 401 4/4/2023
7.7.7 460 3/21/2023
7.7.6 456 3/18/2023
7.7.4 382 3/13/2023
7.7.3 454 2/20/2023
7.7.2 379 2/13/2023
7.7.1 439 2/1/2023
7.6.6 535 1/5/2023
7.6.5 415 12/24/2022
7.6.4 453 12/7/2022
7.6.3 480 11/26/2022
7.6.2 458 11/16/2022
7.5.16 476 11/14/2022
7.5.15 470 11/13/2022
7.5.14 501 11/11/2022
7.5.13 467 11/10/2022
7.5.12 497 10/31/2022
7.5.11 533 10/30/2022
7.5.10 510 10/25/2022
7.5.9 508 10/9/2022
7.5.8 491 10/6/2022
7.5.7 513 10/3/2022
7.5.6 559 9/26/2022
7.5.5 561 9/23/2022
7.5.4 561 9/20/2022
7.5.3 553 9/16/2022
7.5.2 578 8/28/2022
7.5.1 584 8/26/2022
7.4.9.1 645 8/3/2022
7.4.8 621 7/31/2022
7.4.7 615 7/25/2022
7.4.6 647 7/19/2022
7.4.5 668 7/15/2022
7.4.4 670 7/6/2022
7.4.3 665 6/8/2022
7.4.2 659 5/11/2022
7.4.1 633 5/3/2022
7.3.9 648 4/19/2022
7.3.6 640 3/25/2022
7.3.5 614 3/17/2022
7.3.4 616 3/15/2022
7.3.2 574 2/23/2022
7.3.1 570 2/17/2022
6.14.11 478 9/1/2021
6.14.10 584 7/18/2021
6.13.14 474 5/10/2021
6.13.13 501 5/5/2021

LPRun 6.14.10