wwm.LeetCodeHelper
0.7.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 wwm.LeetCodeHelper --version 0.7.0
NuGet\Install-Package wwm.LeetCodeHelper -Version 0.7.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="wwm.LeetCodeHelper" Version="0.7.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add wwm.LeetCodeHelper --version 0.7.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: wwm.LeetCodeHelper, 0.7.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 wwm.LeetCodeHelper as a Cake Addin #addin nuget:?package=wwm.LeetCodeHelper&version=0.7.0 // Install wwm.LeetCodeHelper as a Cake Tool #tool nuget:?package=wwm.LeetCodeHelper&version=0.7.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
wwm.leetcode.helper.issue
介绍
wwm.leetcode.helper 是 C# 刷LeetCode帮助包 本仓库为wwm.leetcode.helper帮助包收集ISSUE仓库
wwm.leetcode.helper 特点:
- 自动下载原题
- 自动将原题测试案例生成测试数据
- 自动添加方法默认返回值
- 自动比较方法返回值,并输出正确与错误数据的对比
- 自动在新建的文件中增加测试接口ITest
软件架构
- .NET6
- Playwright
- Roslyn
安装教程
- 从nuget上搜索wwm.leetcode.helper
- 拉取题库使用的是Playwright工具, 如果报找不到Playwright或报本地未安装Chromium浏览器,请前往官网下载安装 测试安装playwright主要安装步骤,关键是安装缺失的Chromium浏览器
# Create project
dotnet new console -n PlaywrightDemo
cd PlaywrightDemo
# Add project dependency
dotnet add package Microsoft.Playwright
# Build the project
dotnet build
# Install required browsers
pwsh bin\Debug\netX\playwright.ps1 install
使用说明
方式一: 创建Console控制台应用程序,Program.cs 内容如下
//使用手动输入题目url的方式生成测试文件
Console.WriteLine($"Hello, {nameof(wwm.LeetCodeHelper)}");
List<string> problemUrls = new List<string>()
{
//"https://leetcode-cn.com/problems/repeated-string-match/"
};
if (problemUrls.Any())
await LeetCodeHelper.GetContentFromBrowserAsync(problemUrls, "Solutions", "Content", SlowMo: 1, Headless: true);
else
TestResultHelper.InvokeAllTest(typeof(Program).Assembly.GetName().Name);
Console.Write("按任意键退出...");
Console.ReadKey();
方式二:
//使用自动生成当天题目文件且自动测试的方式
await LeetCodeHelper.GetTodayRecordContentOrInvokeTestAsync(typeof(Program).Assembly.GetName().Name, "Solutions", "Content", SlowMo: 0, Headless: false);
Console.Write("按任意键退出...");
Console.ReadKey();
具体使用可参照作者本人刷leetcode仓库地址 https://gitee.com/wwmin/LeetCodeCSharp.git
参与贡献
- 欢迎安装nuget包试用
- 欢迎积极提issue
使用方法
- 输入leetcode url地址,运行可自动生成C#原题及测试数据文件,文件自动下载到指定文件夹路径下
- 使用手动输入题URL的方式时, 测试代码前需要先注释掉 Program.cs 下的problemUrls url值
- 需要在待测文件类上继承 ITest 接口,不需要测试类要删除 ITest
- 然后F5运行测试,自动比较结果,输出正确结果或错误结果比较
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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.
-
net6.0
- Microsoft.CodeAnalysis.CSharp (>= 4.0.1)
- Microsoft.Playwright (>= 1.17.3)
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 |
---|---|---|
0.10.0 | 397 | 2/1/2023 |
0.9.5 | 328 | 12/29/2022 |
0.9.4 | 318 | 12/8/2022 |
0.9.3 | 334 | 12/5/2022 |
0.9.2 | 347 | 12/2/2022 |
0.9.1 | 338 | 12/2/2022 |
0.9.0 | 340 | 12/2/2022 |
0.8.12 | 335 | 12/1/2022 |
0.8.11 | 458 | 9/30/2022 |
0.8.10 | 427 | 9/29/2022 |
0.8.9 | 421 | 9/8/2022 |
0.8.8 | 458 | 8/30/2022 |
0.8.7 | 433 | 8/27/2022 |
0.8.6 | 432 | 8/24/2022 |
0.8.5 | 526 | 2/14/2022 |
0.8.4 | 460 | 2/6/2022 |
0.8.3 | 480 | 2/5/2022 |
0.8.2 | 468 | 2/4/2022 |
0.8.1 | 478 | 2/4/2022 |
0.8.0 | 474 | 2/4/2022 |
0.7.5 | 476 | 1/28/2022 |
0.7.4 | 533 | 1/26/2022 |
0.7.3 | 481 | 1/26/2022 |
0.7.2 | 488 | 1/26/2022 |
0.7.1 | 480 | 1/16/2022 |
0.7.0 | 471 | 1/16/2022 |
0.6.2 | 494 | 1/15/2022 |
0.6.1 | 481 | 1/15/2022 |
0.6.0 | 316 | 1/7/2022 |
0.5.2 | 323 | 12/28/2021 |
0.5.1 | 339 | 12/23/2021 |
0.5.0 | 277 | 12/23/2021 |
0.4.0 | 309 | 12/23/2021 |
0.3.0 | 314 | 12/22/2021 |
0.2.0 | 325 | 12/16/2021 |
0.1.0 | 419 | 9/10/2021 |