Agilent.Testables.Process
1.0.6
Prefix Reserved
.NET 8.0
This package targets .NET 8.0. The package is compatible with this framework or higher.
.NET Framework 4.8
This package targets .NET Framework 4.8. The package is compatible with this framework or higher.
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" />
<PackageReference Include="Agilent.Testables.Process" />
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
#tool nuget:?package=Agilent.Testables.Process&version=1.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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
- 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(...);
}
}
- In your IOC Container register
IProcess
andAgilent.Ace.Testables.Process
:
_services.AddTransient<IProcess, ProcessWrapper>();
- 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 | Versions 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.
-
.NETFramework 4.8
- System.Security.SecureString (>= 4.3.0)
-
.NETFramework 4.8.1
- System.Security.SecureString (>= 4.3.0)
-
net8.0-windows7.0
- System.Security.SecureString (>= 4.3.0)
-
net9.0-windows7.0
- System.Security.SecureString (>= 4.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release