forked from gongxuegit/tiku-backend.net
feat: enforce tenant isolation and shared question bank
This commit is contained in:
@@ -201,15 +201,21 @@ public sealed class ContentNavigationEndpointTests
|
||||
PrimaryCollectionId = collectionId,
|
||||
Type = "choice",
|
||||
Status = QuestionStatus.Archived
|
||||
},
|
||||
new QuestionCollectionItem
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
TenantId = tenantId,
|
||||
CollectionId = collectionId,
|
||||
QuestionId = archivedQuestionId,
|
||||
SortOrder = 2
|
||||
});
|
||||
var archivedReference = await factory.SeedQuestionReferenceAsync(
|
||||
tenantId,
|
||||
tenantId,
|
||||
archivedQuestionId);
|
||||
await factory.SeedAsync(new QuestionCollectionItem
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
TenantId = tenantId,
|
||||
CollectionId = collectionId,
|
||||
QuestionReferenceId = archivedReference.Id,
|
||||
QuestionOwnerTenantId = tenantId,
|
||||
QuestionId = archivedQuestionId,
|
||||
SortOrder = 2
|
||||
});
|
||||
await factory.SeedQuestionWithVersionAsync(
|
||||
new Question
|
||||
{
|
||||
@@ -227,11 +233,17 @@ public sealed class ContentNavigationEndpointTests
|
||||
QuestionId = publishedQuestionId,
|
||||
Content = "题干"
|
||||
});
|
||||
var publishedReference = await factory.SeedQuestionReferenceAsync(
|
||||
tenantId,
|
||||
tenantId,
|
||||
publishedQuestionId);
|
||||
await factory.SeedAsync(new QuestionCollectionItem
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
TenantId = tenantId,
|
||||
CollectionId = collectionId,
|
||||
QuestionReferenceId = publishedReference.Id,
|
||||
QuestionOwnerTenantId = tenantId,
|
||||
QuestionId = publishedQuestionId,
|
||||
SortOrder = 1,
|
||||
Score = 2
|
||||
|
||||
Reference in New Issue
Block a user