Skip to content

Commit

Permalink
Add missing test cases for previous_source_ids
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmus committed Sep 7, 2021
1 parent 6e6724b commit 612cc4b
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

using System.Linq;
using EventFlow.Core;
using EventFlow.Snapshots;
using EventFlow.TestHelpers;
using EventFlow.TestHelpers.Extensions;
Expand All @@ -44,6 +46,7 @@ public void DeserializesCorrectly()
aggregate_sequence_number = "42",
snapshot_name = "thingy",
snapshot_version = "84",
previous_source_ids = "cool,magic,"
}.ToJson();

// Act
Expand All @@ -55,6 +58,7 @@ public void DeserializesCorrectly()
snapshotMetadata.AggregateSequenceNumber.Should().Be(42);
snapshotMetadata.SnapshotName.Should().Be("thingy");
snapshotMetadata.SnapshotVersion.Should().Be(84);
snapshotMetadata.PreviousSourceIds.Select(s => s.Value).Should().BeEquivalentTo("cool", "magic");
}

[Test]
Expand All @@ -68,6 +72,11 @@ public void GettersAndSettersWork()
AggregateSequenceNumber = 42,
SnapshotName = "thingy",
SnapshotVersion = 84,
PreviousSourceIds = new []
{
new SourceId("cool"),
new SourceId("magic")
}
};

// Act
Expand All @@ -80,6 +89,7 @@ public void GettersAndSettersWork()
deserializedSnapshotMetadata.AggregateSequenceNumber.Should().Be(42);
deserializedSnapshotMetadata.SnapshotName.Should().Be("thingy");
deserializedSnapshotMetadata.SnapshotVersion.Should().Be(84);
deserializedSnapshotMetadata.PreviousSourceIds.Select(s => s.Value).Should().BeEquivalentTo("cool", "magic");
}

[Test]
Expand Down

0 comments on commit 612cc4b

Please sign in to comment.