Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Add unit tests for the query and command builders

Đang mở Phù hợp với người mới
#17 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
88/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp
Lĩnh vực
testing

Hướng nghiên cứu

Đọc QuickbaseNet/Helpers/QuickbaseQueryBuilder.cs và QuickbaseNet/Helpers/QuickbaseCommandBuilder.cs, sau đó dùng QuickbaseNet.UnitTests/Tests/QuickbaseClientTests.cs làm tài liệu tham khảo về phong cách. Thêm hai tệp kiểm thử builder được nêu trong QuickbaseNet.UnitTests/Tests/ và bao phủ từng hành vi được liệt kê bằng cách tạo request rồi xác nhận các đối tượng được trả về. Chạy dotnet test --filter FullyQualifiedName~BuilderTests; hoàn tất khi mọi trường hợp đều đạt và không có tệp nào dưới QuickbaseNet/ bị thay đổi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
C#
Star
3
Fork
2
Merge trung bình
5 giờ 53 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của hazeliscoding/quickbase-net

Tất cả issue của hazeliscoding/quickbase-net

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.