Agilent.Testables.Process 1.0.6

Prefix Reserved
dotnet add package Agilent.Testables.Process --version 1.0.6
                    
NuGet\Install-Package Agilent.Testables.Process -Version 1.0.6
                    
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="Agilent.Testables.Process" Version="1.0.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Agilent.Testables.Process" Version="1.0.6" />
                    
Directory.Packages.props
<PackageReference Include="Agilent.Testables.Process" />
                    
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 Agilent.Testables.Process --version 1.0.6
                    
#r "nuget: Agilent.Testables.Process, 1.0.6"
                    
#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 Agilent.Testables.Process@1.0.6
                    
#: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=Agilent.Testables.Process&version=1.0.6
                    
Install as a Cake Addin
#tool nuget:?package=Agilent.Testables.Process&version=1.0.6
                    
Install as a Cake Tool

Agilent.Testables.Process

This package contains an abstraction of the System.Process class found in .NET Framework 4.8 and above. It allows for an IProcessFactory interface to be used instead and for mocks to be created.

Usage

  1. Pass IProcessFactory as a dependency via the constructor into the class you want to test:
public class TestableClass
{
    private readonly IProcessFactory _processFactory;

    public TestableClass(IProcessFactory processFactory)
    {
        _processFactory = processFactory;
    }

    public void DoWork()
    {
        _processFactory.Start(...);
    }
}
  1. In your IOC Container register IProcess and Agilent.Ace.Testables.Process:
_services.AddTransient<IProcess, ProcessWrapper>();
  1. In your tests, verify that the correct method and args are called:
[TestMethod]
public void Should_StartProcess_When_DoWorkPerformed()
{
    // Arrange
    var mockProcessFactory = new Mock<IProcessFactory>();
    var sut = new TestableClass(mockProcessFactory.Object);

    // Act
    sut.DoWork();

    // Assert
    mockProcessFactory.Verify(x => x.Start(...), Times.Once);
}
Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net9.0-windows7.0 is compatible.  net10.0-windows was computed. 
.NET Framework net48 is compatible.  net481 is compatible. 
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
1.0.6 165 1/7/2025
1.0.4-dev 97 1/6/2025

Initial release