tests: adding missing tests for newly introduced classes
This commit is contained in:
@@ -18,4 +18,12 @@ public class CharacterLocationCitation : Citation
|
||||
/// </summary>
|
||||
[JsonPropertyName("end_char_index")]
|
||||
public int EndCharIndex { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CharacterLocationCitation"/> class.
|
||||
/// </summary>
|
||||
/// <returns>A new instance of <see cref="CharacterLocationCitation"/>.</returns>
|
||||
public CharacterLocationCitation() : base(CitationType.CharacterLocation)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,4 +29,19 @@ public abstract class Citation
|
||||
/// </summary>
|
||||
[JsonPropertyName("document_title")]
|
||||
public string DocumentTitle { get; init; } = string.Empty;
|
||||
|
||||
[JsonConstructor]
|
||||
internal Citation()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Citation"/> class with a specified type.
|
||||
/// </summary>
|
||||
/// <param name="type">The type of the citation.</param>
|
||||
/// <returns>A new instance of <see cref="Citation"/>.</returns>
|
||||
protected Citation(string type)
|
||||
{
|
||||
Type = type;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,9 @@ public class CitationDelta : ContentDelta
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CitationDelta"/> class.
|
||||
/// </summary>
|
||||
/// <param name="citation">The citation to associate with this delta.</param>
|
||||
/// <exception cref="ArgumentNullException">Thrown when <paramref name="citation"/> is null.</exception>
|
||||
/// <returns>A new instance of <see cref="CitationDelta"/>.</returns>
|
||||
public CitationDelta(Citation citation) : base(ContentDeltaType.CitationDelta)
|
||||
{
|
||||
ArgumentValidator.ThrowIfNull(citation, nameof(citation));
|
||||
|
||||
@@ -18,4 +18,12 @@ public class ContentBlockLocationCitation : Citation
|
||||
/// </summary>
|
||||
[JsonPropertyName("end_block_index")]
|
||||
public int EndBlockIndex { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ContentBlockLocationCitation"/> class.
|
||||
/// </summary>
|
||||
/// <returns>A new instance of <see cref="ContentBlockLocationCitation"/>.</returns>
|
||||
public ContentBlockLocationCitation() : base(CitationType.ContentBlockLocation)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -18,4 +18,12 @@ public class PageLocationCitation : Citation
|
||||
/// </summary>
|
||||
[JsonPropertyName("end_page_number")]
|
||||
public int EndPageNumber { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PageLocationCitation"/> class.
|
||||
/// </summary>
|
||||
/// <returns>A new instance of <see cref="PageLocationCitation"/>.</returns>
|
||||
public PageLocationCitation() : base(CitationType.PageLocation)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user