Skip to content

Commit

Permalink
Merge pull request #50 from GavinPower747/development
Browse files Browse the repository at this point in the history
Release 1.3.4
  • Loading branch information
GavinPower747 authored May 20, 2018
2 parents aa126d5 + f953570 commit ad2ce79
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 7 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1.3.3.{build}
version: 1.3.4.{build}
image: Visual Studio 2017
skip_tags: true

Expand Down
3 changes: 3 additions & 0 deletions src/pubg-dotnet/Models/Stats/PubgGameModeStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public class PubgGameModeStats
[JsonProperty]
public int Heals { get; set; }

[JsonProperty]
public float KillPoints { get; set; }

[JsonProperty]
public int Kills { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion src/pubg-dotnet/pubg-dotnet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Description>Sync and Async client library for communicating with the Pubg Developer API supporting .net standard 2.0</Description>
<AssemblyTitle>Pubg.Net</AssemblyTitle>
<Version>1.3.3</Version>
<Version>1.3.4</Version>
<Authors>Gavin Power</Authors>
<TargetFramework>netstandard2.0;net45</TargetFramework>
<AssemblyName>Pubg.Net</AssemblyName>
Expand Down
30 changes: 28 additions & 2 deletions test/pubg-dotnet.Tests/Matches/MatchTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

namespace Pubg.Net.Tests.Matches
{
public class MatchTests : TestBase
public class MatchTests
{
[Fact]
public void Can_Retrieve_Match()
public void Can_Retrieve_Match_ForPC()
{
var region = PubgRegion.PCEurope;
var samples = Storage.GetSamples(region);
Expand All @@ -37,6 +37,32 @@ public void Can_Retrieve_Match()
Assert.All(participants, p => p.Id.Should().NotBeNullOrWhiteSpace());
}

[Fact]
public void Can_Retrieve_Match_ForXbox()
{
var region = PubgRegion.XboxEurope;
var samples = Storage.GetSamples(region);
var matchService = new PubgMatchService(Storage.ApiKey);

var match = matchService.GetMatch(region, samples.MatchIds.FirstOrDefault());

match.ShardId.Should().Equals(region.Serialize());
match.Rosters.Should().NotBeNull();

Assert.All(match.Rosters, r => r.Stats.Rank.Should().BeGreaterThan(0));
match.Rosters.Should().ContainSingle(x => x.Won == true);

var participants = match.Rosters.SelectMany(x => x.Participants);

participants.Should().NotBeNullOrEmpty();

Assert.All(participants, p => p.Stats.Should().NotBeNull());
Assert.All(participants, p => p.Stats.KillPlace.Should().BeGreaterThan(0));
Assert.All(participants, p => p.Stats.WinPlace.Should().BeGreaterThan(0));
Assert.All(participants, p => p.ShardId.Should().Equals(region.Serialize()));
Assert.All(participants, p => p.Id.Should().NotBeNullOrWhiteSpace());
}

[Fact]
public void Throws_Exception_When_NotFound()
{
Expand Down
29 changes: 26 additions & 3 deletions test/pubg-dotnet.Tests/Telemetry/TelemetryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,39 @@ namespace Pubg.Net.Tests.Telemetry
public class TelemetryTests : TestBase
{
[Fact]
public void Can_Pull_Telemetry_From_Match()
public void Can_Pull_Telemetry_From_Match_OnPc()
{
var match = Storage.GetMatch(PubgRegion.PCEurope);
var region = PubgRegion.PCEurope;
var match = Storage.GetMatch(region);
var asset = match.Assets.FirstOrDefault();
var telemetryService = new PubgTelemetryService();

var telemetry = telemetryService.GetTelemetry(PubgRegion.PCEurope, asset);
var telemetry = telemetryService.GetTelemetry(region, asset);

telemetry.Should().NotBeEmpty();
Assert.All(telemetry, t => t.Should().NotBeOfType<UnknownTelemetryEvent>());

var matchDefinition = telemetry.OfType<LogMatchDefinition>().FirstOrDefault();

matchDefinition.MatchId.Should().NotBeNullOrWhiteSpace();
}

[Fact]
public void Can_Pull_Telemetry_From_Match_OnXbox()
{
var region = PubgRegion.XboxEurope;
var match = Storage.GetMatch(region);
var asset = match.Assets.FirstOrDefault();
var telemetryService = new PubgTelemetryService();

var telemetry = telemetryService.GetTelemetry(region, asset);

telemetry.Should().NotBeEmpty();
Assert.All(telemetry, t => t.Should().NotBeOfType<UnknownTelemetryEvent>());

var matchDefinition = telemetry.OfType<LogMatchDefinition>().FirstOrDefault();

matchDefinition.MatchId.Should().NotBeNullOrWhiteSpace();
}
}
}

0 comments on commit ad2ce79

Please sign in to comment.