Conversation
…ts, gate POST tests on Create The auto-generated CRUD tests missed operations depending on which flags users set in [CrudApi(Operations = ...)]: - Entities decorated with [ImTiredOfCrud] (bridge alias from ZibStack.NET.UI) generate endpoints but were invisible to the test scanner — it only matched the literal "CrudApiAttribute" class name. - Update and Delete were only exercised inside the combined FullCrudCycle_CreateReadUpdateDelete test, which requires all four of Create/GetById/Update/Delete. For any Operations combination missing one of them (e.g. Write-only, which excludes Read), Update and Delete silently got no coverage. - BulkDelete_ActuallyDeletesItems required Create+GetById. With BulkDelete enabled but GetById off, no bulk-delete test was emitted at all. - ComplexFilter_AND/OR/Grouped and the collection Any/All tests sit under the query-DSL block gated only on GetList, but they POST to seed known values. With Operations=Read (no Create) these emitted tests that 405'd against the disabled POST endpoint. Fixes: - ScanForCrudApi now accepts CrudApiAttribute OR ImTiredOfCrudAttribute, preferring CrudApi when both are present. - New per-endpoint tests emitted in addition to FullCrudCycle: Update_ModifiesEntity / Update_ReturnsOk and Delete_RemovesEntity / Delete_ReturnsNoContent, with a no-GetById fallback that extracts the id from the POST response body. - BulkDelete_ReturnsOk fallback for the BulkDelete+Create (no GetById) combination. - ComplexFilter and collection tests now also require OpCreate in their outer gate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ts, gate POST tests on Create
The auto-generated CRUD tests missed operations depending on which flags users set in [CrudApi(Operations = ...)]:
Entities decorated with [ImTiredOfCrud] (bridge alias from ZibStack.NET.UI) generate endpoints but were invisible to the test scanner — it only matched the literal "CrudApiAttribute" class name.
Update and Delete were only exercised inside the combined FullCrudCycle_CreateReadUpdateDelete test, which requires all four of Create/GetById/Update/Delete. For any Operations combination missing one of them (e.g. Write-only, which excludes Read), Update and Delete silently got no coverage.
BulkDelete_ActuallyDeletesItems required Create+GetById. With BulkDelete enabled but GetById off, no bulk-delete test was emitted at all.
ComplexFilter_AND/OR/Grouped and the collection Any/All tests sit under the query-DSL block gated only on GetList, but they POST to seed known values. With Operations=Read (no Create) these emitted tests that 405'd against the disabled POST endpoint.
Fixes: