NosimusAI.TestSuite
1.0.10
dotnet add package NosimusAI.TestSuite --version 1.0.10
NuGet\Install-Package NosimusAI.TestSuite -Version 1.0.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="NosimusAI.TestSuite" Version="1.0.10" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NosimusAI.TestSuite" Version="1.0.10" />
<PackageReference Include="NosimusAI.TestSuite" />
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 NosimusAI.TestSuite --version 1.0.10
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NosimusAI.TestSuite, 1.0.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.
#:package NosimusAI.TestSuite@1.0.10
#: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=NosimusAI.TestSuite&version=1.0.10
#tool nuget:?package=NosimusAI.TestSuite&version=1.0.10
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
NOSIMUS AI FOR .NET
This package allows users to
- test their code against business requirements using AI
- generate Gherkin test cases using AI
- generate Gherkin test cases for AspNet controllers
Under the hood it uses call graph from entry point as a context
How to setup
- Install Nosimus AI package and CSharp code analysis packages
dotnet add package NosimusAI.TestSuite
dotnet add package Microsoft.CodeAnalysis.CSharp
dotnet add package Microsoft.CodeAnalysis.CSharp.Workspaces
- Add the following section to your configuration (either in appsettings.json or code config)
{
"Nosimus": {
"OpenAiKey": "",
"SolutionPath": "Full path to .sln file",
"OpenAiModel": "gpt-4o"
}
}
- Register Nosimus AI services
serviceCollection.AddNosimusAI(configuration);
How to write a test
using NosimusAI;
[Test]
public async Task ShouldPassBusinessRequirement()
{
var service = GlobalTestSetup.ServiceProvider!.GetRequiredService<TestRunner>();
var result = await service.RunTest(
@"Must borrow the book.
Must ensure that book was not borrowed more than 30 days ago.
Must ensure that abonent did not borrow more than 3 books.",
typeof(Book), // Class (entry point)
"Borrow", // Method (entry point)
CancellationToken.None);
Assert.That(result.Passed, Is.EqualTo(true));
}
How to generate Gherkin test case
var generator = serviceProvider.GetRequiredService<BusinessRequirementExtractor>();
var tests = await generator.GenerateGherkin(typeof(Book), "Borrow", CancellationToken.None);
How to generate Gherkin test cases for AspNet controllers
var generator = serviceProvider.GetRequiredService<BusinessRequirementExtractor>();
var assembly = Assembly.Load(...);
var tests = await generator.GenerateGherkinForAspNetControllers(assembly, CancellationToken.None);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- JetBrains.Annotations (>= 2024.3.0)
- Microsoft.AspNetCore.Mvc (>= 2.3.0)
- Microsoft.Build (>= 17.11.4)
- Microsoft.Build.Locator (>= 1.7.8)
- Microsoft.CodeAnalysis.CSharp (>= 4.12.0)
- Microsoft.CodeAnalysis.Workspaces.MSBuild (>= 4.12.0)
- Microsoft.Extensions.Configuration (>= 9.0.2)
- Microsoft.Extensions.DependencyInjection (>= 9.0.2)
- Microsoft.Extensions.Options (>= 9.0.2)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.2)
- Microsoft.Extensions.Options.DataAnnotations (>= 9.0.2)
- OpenAI (>= 2.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.