Add person data access, integ tests, backup/restore (#17)
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
/// <summary>
|
||||
/// Integration tests for <see cref="IPostData" /> implementations
|
||||
/// </summary>
|
||||
/// <summary>Integration tests for <see cref="IPostData" /> implementations</summary>
|
||||
module PostDataTests
|
||||
|
||||
open System
|
||||
@@ -39,6 +37,12 @@ let private testPost1Published = Instant.FromDateTimeOffset(DateTimeOffset.Parse
|
||||
/// The category IDs for "Spitball" (parent) and "Moonshot"
|
||||
let private testCatIds = [ CategoryId "jw6N69YtTEWVHAO33jHU-w"; CategoryId "ScVpyu1e7UiP7bDdge3ZEw" ]
|
||||
|
||||
/// The person ID for "Crackpot"
|
||||
let private crackpotPersonId = PersonId "Q-6ElUj4cEyg5_wQeMpH_A"
|
||||
|
||||
/// The person ID for "Buzzkill" (RIP, JCD)
|
||||
let private buzzkillPersonId = PersonId "a8M4gN58R0evXnJEt9j95w"
|
||||
|
||||
/// Ensure that a list of posts has text for each post
|
||||
let private ensureHasText (posts: Post list) =
|
||||
for post in posts do Expect.isNotEmpty post.Text $"Text should not be blank (post ID {post.Id})"
|
||||
@@ -129,6 +133,11 @@ let ``FindById succeeds when a post is found`` (data: IData) = task {
|
||||
Expect.equal ep.SeasonDescription (Some "The First Season") "Episode season description is incorrect"
|
||||
Expect.equal ep.EpisodeNumber (Some 1.) "Episode number is incorrect"
|
||||
Expect.equal ep.EpisodeDescription (Some "The first episode ever!") "Episode description is incorrect"
|
||||
Expect.isSome ep.People "There should have been people on the episode"
|
||||
let ppl = ep.People.Value
|
||||
Expect.hasLength ppl 2 "There should have been 2 people on the episode"
|
||||
Expect.contains ppl { PersonId = crackpotPersonId; Role = CoHost } "Crackpot not found on episode"
|
||||
Expect.contains ppl { PersonId = buzzkillPersonId; Role = VoiceActor } "Buzzkill not found on episode"
|
||||
Expect.equal
|
||||
it.Metadata
|
||||
[ { Name = "Density"; Value = "Non-existent" }; { Name = "Intensity"; Value = "Low" } ]
|
||||
|
||||
Reference in New Issue
Block a user