public void Can_Get_MatchSamples_When_NoFilterGiven()
        {
            var region         = PubgPlatform.Steam;
            var samplesService = new PubgSamplesService(Storage.ApiKey);

            var matchSamples = samplesService.GetMatchSamples(region);

            matchSamples.Should().NotBeNull();
            matchSamples.MatchIds.Should().NotBeNullOrEmpty();
            matchSamples.ShardId.Should().BeEquivalentTo(region.Serialize());
        }
        public void Can_Get_MatchSamples_When_FilterGiven()
        {
            var region         = PubgPlatform.Steam;
            var samplesService = new PubgSamplesService(Storage.ApiKey);
            var createdDate    = DateTime.UtcNow.AddDays(-2);

            var matchSamples = samplesService.GetMatchSamples(region, new GetSamplesRequest {
                CreatedAtStart = createdDate
            });

            matchSamples.Should().NotBeNull();
            matchSamples.MatchIds.Should().NotBeNullOrEmpty();
            matchSamples.ShardId.Should().BeEquivalentTo(region.Serialize());
        }
示例#3
0
        public static PubgMatchSample GetSamples(PubgRegion region)
        {
            var samples = StoredItems.OfType<PubgMatchSample>().FirstOrDefault(p => p.ShardId == region.Serialize());

            if (samples != null)
                return samples;

            var sampleService = new PubgSamplesService(ApiKey);

            samples = sampleService.GetMatchSamples(region);

            StoredItems.Add(samples);

            return samples;
        }
示例#4
0
        public static PubgMatchSample GetSamples(PubgPlatform platform)
        {
            var samples = StoredItems.OfType <PubgMatchSample>().FirstOrDefault(p => p.ShardId == platform.Serialize());

            if (samples != null)
            {
                return(samples);
            }

            var sampleService = new PubgSamplesService(ApiKey);

            samples = sampleService.GetMatchSamples(platform);

            StoredItems.Add(samples);

            return(samples);
        }