Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Add unit tests for the query and command builders

未关闭 适合新手
#17 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
88/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
csharp
领域
testing

调研方向

阅读 QuickbaseNet/Helpers/QuickbaseQueryBuilder.cs 和 QuickbaseNet/Helpers/QuickbaseCommandBuilder.cs,然后参考 QuickbaseNet.UnitTests/Tests/QuickbaseClientTests.cs 的风格。在 QuickbaseNet.UnitTests/Tests/ 下添加指定的两个 builder 测试文件,并通过构建请求、断言返回对象来覆盖列出的每种行为。运行 dotnet test --filter FullyQualifiedName~BuilderTests;所有用例通过且 QuickbaseNet/ 下没有文件发生更改时,即为完成。

由索引模型根据 Issue 内容生成。

描述

good first issue

Neither builder has a test. The 7 existing tests cover the client constructor, QueryRecords and QuickbaseResult. Builder tests don't need the HTTP mock: build a request and assert on the object you get back.

What to do

Add QuickbaseQueryBuilderTests.cs and QuickbaseCommandBuilderTests.cs under QuickbaseNet.UnitTests/Tests/, in the style of the existing tests. Cover at least:

  • Build() copies From, Select and Where into the request.
  • SortBy and GroupBy called twice keep both items, in order.
  • Select called twice keeps only the last list.
  • With nothing set, SortBy, GroupBy and Options are null.
  • AddNewRecord twice gives two entries in Data, and ReturnFields ends up in FieldsToReturn.
  • UpdateRecord(8, ...) adds field "3" with the string value "8" next to the configured fields.
  • AddFields sets every field, and AddField twice on one ID keeps the last value.
  • BuildDeleteCommand maps ForTable to From and WithDeletionCriteria to Where.

Test what the builders do today. If something looks wrong, say so in the PR instead of changing the builder.

Where to look

  • QuickbaseNet/Helpers/QuickbaseQueryBuilder.cs
  • QuickbaseNet/Helpers/QuickbaseCommandBuilder.cs (field 3 is set at line 65)
  • QuickbaseNet.UnitTests/Tests/QuickbaseClientTests.cs for style

Done when

  • Every case above has a passing test
  • Nothing under QuickbaseNet/ changes

Testing it

dotnet test --filter FullyQualifiedName~BuilderTests
主要语言
C#
星标
3
派生
2
平均合并
5 小时 53 分钟
30 天内合并 PR
1

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

hazeliscoding/quickbase-net 的其他 Issue

查看 hazeliscoding/quickbase-net 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。