Skip to content

Commit

Permalink
Made all snapshot tests virtual (#7093)
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiasJakobsson authored Feb 12, 2024
1 parent f623f42 commit a8146c6
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/core/Akka.Persistence.TCK/Snapshot/SnapshotStoreSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,21 @@ private IEnumerable<SnapshotMetadata> WriteSnapshots()
}

[Fact]
public void SnapshotStore_should_not_load_a_snapshot_given_an_invalid_persistence_id()
public virtual void SnapshotStore_should_not_load_a_snapshot_given_an_invalid_persistence_id()
{
SnapshotStore.Tell(new LoadSnapshot("invalid", SnapshotSelectionCriteria.Latest, long.MaxValue), _senderProbe.Ref);
_senderProbe.ExpectMsg<LoadSnapshotResult>(result => result.Snapshot == null && result.ToSequenceNr == long.MaxValue);
}

[Fact]
public void SnapshotStore_should_not_load_a_snapshot_given_non_matching_timestamp_criteria()
public virtual void SnapshotStore_should_not_load_a_snapshot_given_non_matching_timestamp_criteria()
{
SnapshotStore.Tell(new LoadSnapshot(Pid, new SnapshotSelectionCriteria(long.MaxValue, new DateTime(100000)), long.MaxValue), _senderProbe.Ref);
_senderProbe.ExpectMsg<LoadSnapshotResult>(result => result.Snapshot == null && result.ToSequenceNr == long.MaxValue);
}

[Fact]
public void SnapshotStore_should_not_load_a_snapshot_given_non_matching_sequence_number_criteria()
public virtual void SnapshotStore_should_not_load_a_snapshot_given_non_matching_sequence_number_criteria()
{
SnapshotStore.Tell(new LoadSnapshot(Pid, new SnapshotSelectionCriteria(7), long.MaxValue), _senderProbe.Ref);
_senderProbe.ExpectMsg<LoadSnapshotResult>(result => result.Snapshot == null && result.ToSequenceNr == long.MaxValue);
Expand All @@ -131,7 +131,7 @@ public void SnapshotStore_should_not_load_a_snapshot_given_non_matching_sequence
}

[Fact]
public void SnapshotStore_should_load_the_most_recent_snapshot()
public virtual void SnapshotStore_should_load_the_most_recent_snapshot()
{
SnapshotStore.Tell(new LoadSnapshot(Pid, SnapshotSelectionCriteria.Latest, long.MaxValue), _senderProbe.Ref);
_senderProbe.ExpectMsg<LoadSnapshotResult>(result =>
Expand All @@ -142,7 +142,7 @@ public void SnapshotStore_should_load_the_most_recent_snapshot()
}

[Fact]
public void SnapshotStore_should_load_the_most_recent_snapshot_matching_an_upper_sequence_number_bound()
public virtual void SnapshotStore_should_load_the_most_recent_snapshot_matching_an_upper_sequence_number_bound()
{
SnapshotStore.Tell(new LoadSnapshot(Pid, new SnapshotSelectionCriteria(13), long.MaxValue), _senderProbe.Ref);
_senderProbe.ExpectMsg<LoadSnapshotResult>(result =>
Expand All @@ -160,7 +160,7 @@ public void SnapshotStore_should_load_the_most_recent_snapshot_matching_an_upper
}

[Fact]
public void SnapshotStore_should_load_the_most_recent_snapshot_matching_an_upper_sequence_number_and_timestamp_bound()
public virtual void SnapshotStore_should_load_the_most_recent_snapshot_matching_an_upper_sequence_number_and_timestamp_bound()
{
SnapshotStore.Tell(new LoadSnapshot(Pid, new SnapshotSelectionCriteria(13, Metadata[2].Timestamp), long.MaxValue), _senderProbe.Ref);
_senderProbe.ExpectMsg<LoadSnapshotResult>(result =>
Expand All @@ -178,7 +178,7 @@ public void SnapshotStore_should_load_the_most_recent_snapshot_matching_an_upper
}

[Fact]
public void SnapshotStore_should_delete_a_single_snapshot_identified_by_SequenceNr_in_snapshot_metadata()
public virtual void SnapshotStore_should_delete_a_single_snapshot_identified_by_SequenceNr_in_snapshot_metadata()
{
var md = Metadata[2];
md = new SnapshotMetadata(md.PersistenceId, md.SequenceNr); // don't care about timestamp for delete of a single snap
Expand All @@ -199,7 +199,7 @@ public void SnapshotStore_should_delete_a_single_snapshot_identified_by_Sequence
}

[Fact]
public void SnapshotStore_should_delete_all_snapshots_matching_upper_sequence_number_and_timestamp_bounds()
public virtual void SnapshotStore_should_delete_all_snapshots_matching_upper_sequence_number_and_timestamp_bounds()
{
var md = Metadata[2];
var command = new DeleteSnapshots(Pid, new SnapshotSelectionCriteria(md.SequenceNr, md.Timestamp));
Expand All @@ -223,7 +223,7 @@ public void SnapshotStore_should_delete_all_snapshots_matching_upper_sequence_nu
}

[Fact]
public void SnapshotStore_should_not_delete_snapshots_with_non_matching_upper_timestamp_bounds()
public virtual void SnapshotStore_should_not_delete_snapshots_with_non_matching_upper_timestamp_bounds()
{
var md = Metadata[3];
var criteria = new SnapshotSelectionCriteria(md.SequenceNr, md.Timestamp.Subtract(TimeSpan.FromTicks(1)));
Expand All @@ -244,7 +244,7 @@ public void SnapshotStore_should_not_delete_snapshots_with_non_matching_upper_ti
}

[Fact]
public void SnapshotStore_should_save_and_overwrite_snapshot_with_same_sequence_number()
public virtual void SnapshotStore_should_save_and_overwrite_snapshot_with_same_sequence_number()
{
var md = Metadata[4];
SnapshotStore.Tell(new SaveSnapshot(md, "s-5-modified"), _senderProbe.Ref);
Expand All @@ -258,7 +258,7 @@ public void SnapshotStore_should_save_and_overwrite_snapshot_with_same_sequence_
}

[Fact]
public void SnapshotStore_should_save_bigger_size_snapshot()
public virtual void SnapshotStore_should_save_bigger_size_snapshot()
{
var metadata = new SnapshotMetadata(Pid, 100);
var bigSnapshot = new byte[SnapshotByteSizeLimit];
Expand All @@ -269,7 +269,7 @@ public void SnapshotStore_should_save_bigger_size_snapshot()


[Fact]
public void ShouldSerializeSnapshots()
public virtual void ShouldSerializeSnapshots()
{
if (!SupportsSerialization) return;

Expand Down

0 comments on commit a8146c6

Please sign in to comment.