当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 0 Fork 0

wwmin / wwm.leetcode.helper.issue
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

wwm.leetcode.helper.issue

介绍

wwm.leetcode.helper 是 C# 刷LeetCode帮助包 本仓库为wwm.leetcode.helper帮助包收集ISSUE仓库

wwm.leetcode.helper 特点:

  1. 自动下载原题
  2. 自动将原题测试案例生成测试数据
  3. 自动添加方法默认返回值
  4. 自动比较方法返回值,并输出正确与错误数据的对比
  5. 自动在新建的文件中增加测试接口ITest

软件架构

  • .NET6
  • Playwright
  • Roslyn

安装教程

  1. 从nuget上搜索wwm.leetcode.helper
  2. 拉取题库使用的是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

参与贡献

  1. 欢迎安装nuget包试用
  2. 欢迎积极提issue

使用方法

  1. 输入leetcode url地址,运行可自动生成C#原题及测试数据文件,文件自动下载到指定文件夹路径下
  2. 使用手动输入题URL的方式时, 测试代码前需要先注释掉 Program.cs 下的problemUrls url值
  3. 需要在待测文件类上继承 ITest 接口,不需要测试类要删除 ITest
  4. 然后F5运行测试,自动比较结果,输出正确结果或错误结果比较
MIT License Copyright (c) 2021 wwmin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

wwm.leetcode.helper LeetCode 帮助包收集ISSUE仓库 展开 收起
C#
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C#
1
https://gitee.com/wwmin/wwm.leetcode.helper.issue.git
git@gitee.com:wwmin/wwm.leetcode.helper.issue.git
wwmin
wwm.leetcode.helper.issue
wwm.leetcode.helper.issue
master

搜索帮助