GameDevPro.AlgTester
1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package GameDevPro.AlgTester --version 1.0.0
NuGet\Install-Package GameDevPro.AlgTester -Version 1.0.0
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="GameDevPro.AlgTester" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GameDevPro.AlgTester --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: GameDevPro.AlgTester, 1.0.0"
#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 GameDevPro.AlgTester as a Cake Addin #addin nuget:?package=GameDevPro.AlgTester&version=1.0.0 // Install GameDevPro.AlgTester as a Cake Tool #tool nuget:?package=GameDevPro.AlgTester&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
AlgTester
A simple and flexible API to run Coding Challenge solutions in your IDE. Supports test files.
Note: [Check complete documentation on Github] (https://github.com/gamedev-pro/algorithm-tester-csharp)
How to use
You can just create any static function for your Coding Challenge and run it like this
- C# 10 and above
using AlgTester.API;//Include lib
public static int MyCodingChallengeSolution(int n, int[] arr)
{
return 0;
}
// Save the function you want to test in a variable (it will help C# auto resolve the correct method call)
var solutionFunc = MyCodingChallengeSolution;
// Run your tests
SolutionTester.New()
.WithSolution(solutionFunc)
.WithTestCase(2, new int[] { 1, 3 }, 0) // Type safe Input and output
.WithTestCase(3, new int[] { 2, 3, 5 }, 1) // Another test case (this one will fail)
.WithTestCase(3, new int[] { 2, 3, 5 }, 0) // and another :)
.Run();//Run tests!
- C# 9 and below
using AlgTester.API;//Include lib
public static class Solution
{
public static int MyCodingChallengeSolution(int n, int[] arr)
{
return 0;
}
}
class Program
{
static void Main(string[] args)
{
var solutionFunc = Solution.MyCodingChallengeSolution;
SolutionTester.New()
//No implicity generic method resolution for C# 9.0
.WithSolution<int, int[], int>(solutionFunc)
.WithTestCase(2, new int[] { 1, 3 }, 0) // Type safe Input and output
.WithTestCase(3, new int[] { 2, 3, 5 }, 1) // Another test case (this one will fail)
.WithTestCase(3, new int[] { 2, 3, 5 }, 0) // and another :)
.Run();
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net5.0
- Newtonsoft.Json (>= 13.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.