public void Should_convert_timeline_creation_query_to_dto_and_back_to_description()
        {
            var query = new CreateTimelineQuery("my-timeline", new[] { "foo", "bar" })
            {
                Slices       = 35,
                TTL          = 2.Days(),
                TimetrapSize = 2.Seconds(),
                ShardingKey  = new[] { "key" }
            };

            var dto = TimelineDescriptionDtoConverter.CreateFromQuery(query);

            var description = TimelineDescriptionDtoConverter.ConvertToDescription(dto);

            description.Should().BeEquivalentTo(query);
        }
Esempio n. 2
0
 /// <inheritdoc />
 public Task <HerculesResult> CreateTimelineAsync(CreateTimelineQuery query, TimeSpan timeout)
 => SendAsync(
     Request.Post("timelines/create"),
     TimelineDescriptionDtoConverter.CreateFromQuery(query),
     timeout,
     TimelineAnalyzer);