public void Should_convert_stream_creation_query_to_dto_and_back_to_description(
            [Values(StreamType.Base, StreamType.Derived)]
            StreamType type)
        {
            var query = new CreateStreamQuery("my-stream")
            {
                Type        = type,
                TTL         = 2.Days(),
                Partitions  = 35,
                ShardingKey = new[] { "key" },
                Sources     = new[] { "foo", "bar" }
            };

            var dto = StreamDescriptionDtoConverter.CreateFromQuery(query);

            var description = StreamDescriptionDtoConverter.ConvertToDescription(dto);

            description.Should().BeEquivalentTo(query);
        }
示例#2
0
 /// <inheritdoc />
 public Task <HerculesResult> CreateStreamAsync(CreateStreamQuery query, TimeSpan timeout)
 => SendAsync(
     Request.Post("streams/create"),
     StreamDescriptionDtoConverter.CreateFromQuery(query),
     timeout,
     StreamAnalyzer);