Add synced question bookmarks
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using QuestionsApi.Models;
|
||||
using Xunit;
|
||||
|
||||
namespace QuestionsApi.Tests;
|
||||
|
||||
public sealed class QuestionBookmarkTests
|
||||
{
|
||||
[Fact]
|
||||
public void PublicResponsesDoNotExposeUserOrMongoIdentifiers()
|
||||
{
|
||||
Assert.Null(typeof(QuestionBookmarkSummary).GetProperty(nameof(QuestionBookmark.UserId)));
|
||||
Assert.Null(typeof(QuestionBookmarkSummary).GetProperty(nameof(QuestionBookmark.Id)));
|
||||
Assert.Null(typeof(QuestionBookmarkMutationResponse).GetProperty(nameof(QuestionBookmark.UserId)));
|
||||
Assert.Null(typeof(QuestionBookmarkMutationResponse).GetProperty(nameof(QuestionBookmark.Id)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void QuestionResponseDefaultsToNotBookmarked()
|
||||
{
|
||||
var response = QuestionResponse.FromModel(new Question
|
||||
{
|
||||
ExternalId = "bookmark-test",
|
||||
Choices = [new QuestionChoice { Id = "A", Text = "Answer" }],
|
||||
CorrectChoiceId = "A"
|
||||
});
|
||||
|
||||
Assert.False(response.IsBookmarked);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user