Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add unit tests for the query and command builders

Aperta Adatta ai principianti
#17 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
testing

Direzione di ricerca

Leggi QuickbaseNet/Helpers/QuickbaseQueryBuilder.cs e QuickbaseNet/Helpers/QuickbaseCommandBuilder.cs, quindi usa QuickbaseNet.UnitTests/Tests/QuickbaseClientTests.cs come riferimento di stile. Aggiungi i due file di test dei builder indicati in QuickbaseNet.UnitTests/Tests/ e verifica ogni comportamento elencato creando richieste e asserendo gli oggetti restituiti. Esegui dotnet test --filter FullyQualifiedName~BuilderTests; il lavoro è completato quando tutti i casi passano e nessun file sotto QuickbaseNet/ è stato modificato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
C#
Stelle
3
Fork
2
Merge medio
5h 53m
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di hazeliscoding/quickbase-net

Tutte le issue di hazeliscoding/quickbase-net

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.