Esempio n. 1
0
        public void JsonAggregateSerializer_SerializesAggregateProperly()
        {
            var sut       = new JsonAggregateSerializer();
            var aggregate = new FakeAggregate(Guid.Empty);

            var bytes = sut.Serialize(aggregate);

            Assert.NotNull(bytes);
            Assert.NotEmpty(bytes);
        }
Esempio n. 2
0
        public void JsonAggregateSerializer_DeserializesAggregateProperty()
        {
            var aggregateId = Guid.Parse("00000000-0000-0000-0000-000000000001");
            var version     = 20L;

            var sut       = new JsonAggregateSerializer();
            var bytes     = sut.Serialize(new FakeAggregate(aggregateId, version));
            var aggregate = sut.Deserialize <FakeAggregate>(bytes);

            Assert.Equal(aggregateId, aggregate.Id);
            Assert.Equal(version, aggregate.Version);
        }