Exemplo n.º 1
0
        public void ShouldThrowIfStartIsGreaterThanEnd(int startOffset, int endOffset, QueryDirection direction)
        {
            var query = new StatsRequestParams
            {
                Start     = Now.AddHours(startOffset),
                End       = Now.AddHours(endOffset),
                Direction = direction
            };

            ThrowsAsync <AblyException>(() => ExecuteStatsQuery(query));
        }
Exemplo n.º 2
0
        public async Task ShouldAcceptStartAndEndDateTimes(int startOffset, int endOffset, QueryDirection direction)
        {
            var query = new StatsRequestParams
            {
                Start     = Now.AddHours(startOffset),
                End       = Now.AddHours(endOffset),
                Direction = direction
            };

            await ExecuteStatsQuery(query);

            LastRequest.AssertContainsParameter("start", query.Start.Value.ToUnixTimeInMilliseconds().ToString());
            LastRequest.AssertContainsParameter("end", query.End.Value.ToUnixTimeInMilliseconds().ToString());
        }