Ejemplo n.º 1
0
        public void throw_when_aggregate_root_name_not_provided()
        {
            var builder = new StreamIdBuilder();

            Assert.Throws <ArgumentNullException>(() => builder.Build("region", "context", null, "1"));
            Assert.Throws <ArgumentNullException>(() => builder.Build("region", "context", "", "1"));
        }
Ejemplo n.º 2
0
        public void build_stream_id_from_only_aggregate_root_name()
        {
            var builder           = new StreamIdBuilder();
            var aggregateRootName = "testAr";
            var streamId          = builder.Build(null, null, aggregateRootName, null);

            Assert.Equal(streamId, aggregateRootName, StringComparer.OrdinalIgnoreCase);
        }
Ejemplo n.º 3
0
        public void build_stream_id_from_all_fragments()
        {
            var builder           = new StreamIdBuilder();
            var regionId          = "region";
            var context           = "context";
            var aggregateRootName = "testAr";
            var aggregateRootId   = "1";
            var expectedStreamId  = string.Join(StreamIdBuilder.SEPARATOR, regionId, context, aggregateRootName, aggregateRootId);
            var actualStreamId    = builder.Build(regionId, context, aggregateRootName, aggregateRootId);

            Assert.Equal(expectedStreamId, actualStreamId, StringComparer.OrdinalIgnoreCase);
        }