From 5bc2c5c9caa80c4a98e64a00248c26cab1aad276 Mon Sep 17 00:00:00 2001 From: Gavin Power Date: Wed, 11 Apr 2018 04:29:56 +0100 Subject: [PATCH 01/11] Added initial player tests --- appveyor.yml | 38 +++++++ src/pubg-dotnet/pubg-dotnet.csproj | 19 +--- test/pubg-dotnet.Tests/Class1.cs | 9 -- test/pubg-dotnet.Tests/Players/PlayerTests.cs | 106 ++++++++++++++++++ test/pubg-dotnet.Tests/Util/KnownPlayers.cs | 34 ++++++ test/pubg-dotnet.Tests/Util/Values.cs | 11 ++ .../pubg-dotnet.Tests.csproj | 19 +++- 7 files changed, 208 insertions(+), 28 deletions(-) create mode 100644 appveyor.yml delete mode 100644 test/pubg-dotnet.Tests/Class1.cs create mode 100644 test/pubg-dotnet.Tests/Players/PlayerTests.cs create mode 100644 test/pubg-dotnet.Tests/Util/KnownPlayers.cs create mode 100644 test/pubg-dotnet.Tests/Util/Values.cs diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..25ff1b6 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,38 @@ +version: 1.0.0.{build} +image: Visual Studio 2017 + +environment: + PUBG_API_KEY: + secure: nKrgxWXcCr2GkDIzvtKvEyQNVprTcJzHx56hiB8A8Od16OmcYU6Kv78s7cEecYKo+S/C0Hi6B26cZ+V6RqFw7cpHgj6Vpix9uUfkuluYfWikvgqfFgs1EV3PVMP4Nw6rur3lo2KWe7UOHfI5mDqz4aLB0pWY0oP2uAIvYVsRdB7tk6K6raIiNJL5z+REh6ramPPyGgK3DUjgpUoGByKts8pS8dvMrER48JPoGHfjymbX5zzsypGX/V+48VykcP8FBT+0HQYEAiT3l7/udER+EtZ1FwG6XNZ90NnuL+idcAbKqq0EXfOCPHc8UHDUS6nhmIfRER+0MwgHNeNv3uMo736hw57Vv5TXRN+7aRgonoF/DB9692kjqdTdn5kBJR0l3LEjrNzI3UrBkmaRfoKZxw== + +deploy: +- provider: NuGet + api_key: + secure: tRU8M11vrr1xpuhdmBSOSSjQZXAEQVGHR1dP+f/c+RkA1+ZJqCDY2Rsv9Nk4okeT + on: + branch: master + +before_build: + - dotnet --info + - ps: Write-Host $("Performing Dot Net Restore") + - dotnet restore + +build: + parallel: true + +build_script: + - ps: Write-Host $("Performing build") + - dotnet build -c Release src\pubg-dotnet + - dotnet build -c Debug src\pubg-dotnet + - dotnet build -c Debug test\pubg-dotnet.Tests + +after_build: + - ps: Write-Host $("Performing dotnet pack") + - dotnet pack -c Release src\pubg-dotnet + +test_script: + - ps: Write-Host $("Starting tests") + - dotnet test src\pubg-dotnet.Tests\pubg-dotnet.Tests.csproj + +artifacts: + - path: '**\*.nupkg' \ No newline at end of file diff --git a/src/pubg-dotnet/pubg-dotnet.csproj b/src/pubg-dotnet/pubg-dotnet.csproj index a0f003c..2239ac1 100644 --- a/src/pubg-dotnet/pubg-dotnet.csproj +++ b/src/pubg-dotnet/pubg-dotnet.csproj @@ -4,15 +4,13 @@ Sync and Async client library for communicating with the Pubg Developer API supporting .net standard 2.0 Pubg.Net 0.7 - 0.7 + 1.0 Gavin Power netstandard2.0;net45 Pubg.Net Pubg-DotNet pubg;playerunknown;battlegrounds;developer;api https://github.com/GavinPower747/pubg-dotnet - $(PackageTargetFallback);netcoreapp1.0 - 1.6.1 True @@ -23,21 +21,6 @@ Pubg.Net - - - - - - - - - - - - - - - diff --git a/test/pubg-dotnet.Tests/Class1.cs b/test/pubg-dotnet.Tests/Class1.cs deleted file mode 100644 index f5d3fec..0000000 --- a/test/pubg-dotnet.Tests/Class1.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace pubg_dotnet.UnitTests -{ - public class Class1 - { - - } -} diff --git a/test/pubg-dotnet.Tests/Players/PlayerTests.cs b/test/pubg-dotnet.Tests/Players/PlayerTests.cs new file mode 100644 index 0000000..f3fb526 --- /dev/null +++ b/test/pubg-dotnet.Tests/Players/PlayerTests.cs @@ -0,0 +1,106 @@ +using pubg.net.Tests.Util; +using Pubg.Net; +using Pubg.Net.Exceptions; +using System.Linq; +using System.Threading.Tasks; +using Xunit; + +namespace pubg.net.Tests.Players +{ + public class PlayerTests + { + [Fact] + public void Can_Get_Players_ByName_Sync() + { + var playerService = new PubgPlayerService(Values.ApiKey); + + KnownPlayers.KnownPlayerNames.TryGetValue(PubgRegion.PCEurope, out string[] playerNames); + + var filter = new GetPubgPlayersRequest + { + PlayerNames = playerNames + }; + + var players = playerService.GetPlayers(PubgRegion.PCEurope, filter); + + Assert.NotEmpty(players); + Assert.All(players.Select(p => p.Name), name => playerNames.Contains(name)); + } + + [Fact] + public async Task Can_Get_Players_ByName_Async() + { + var playerService = new PubgPlayerService(Values.ApiKey); + + KnownPlayers.KnownPlayerNames.TryGetValue(PubgRegion.PCEurope, out string[] playerNames); + + var filter = new GetPubgPlayersRequest + { + PlayerNames = playerNames + }; + + var players = await playerService.GetPlayersAsync(PubgRegion.PCEurope, filter); + + Assert.NotEmpty(players); + Assert.All(players.Select(p => p.Name), name => playerNames.Contains(name)); + } + + [Fact] + public void Can_Get_Players_ById_Sync() + { + var playerService = new PubgPlayerService(Values.ApiKey); + + KnownPlayers.KnownPlayerIds.TryGetValue(PubgRegion.PCEurope, out string[] playerIds); + + var filter = new GetPubgPlayersRequest + { + PlayerIds = playerIds + }; + + var players = playerService.GetPlayers(PubgRegion.PCEurope, filter); + + Assert.NotEmpty(players); + Assert.All(players.Select(p => p.Id), id => playerIds.Contains(id)); + } + + [Fact] + public async Task Can_Get_Players_ById_Async() + { + var playerService = new PubgPlayerService(Values.ApiKey); + + KnownPlayers.KnownPlayerIds.TryGetValue(PubgRegion.PCEurope, out string[] playerIds); + + var filter = new GetPubgPlayersRequest + { + PlayerIds = playerIds + }; + + var players = await playerService.GetPlayersAsync(PubgRegion.PCEurope, filter); + + Assert.NotEmpty(players); + Assert.All(players.Select(p => p.Id), id => playerIds.Contains(id)); + } + + [Fact] + public void GetPlayers_Throws_Exception_When_NotFound() + { + var playerService = new PubgPlayerService(Values.ApiKey); + + var filter = new GetPubgPlayersRequest + { + PlayerNames = new string[] { "NonExistantPlayerHopefully" } + }; + + Assert.Throws(() => playerService.GetPlayers(PubgRegion.PCEurope, filter)); + } + + [Fact] + public void GetPlayer_Throws_Exception_When_NotFound() + { + var playerService = new PubgPlayerService(Values.ApiKey); + + Assert.Throws(() => playerService.GetPlayer(PubgRegion.PCEurope, "account.00000000000000000000")); + } + + } +} diff --git a/test/pubg-dotnet.Tests/Util/KnownPlayers.cs b/test/pubg-dotnet.Tests/Util/KnownPlayers.cs new file mode 100644 index 0000000..d289ad8 --- /dev/null +++ b/test/pubg-dotnet.Tests/Util/KnownPlayers.cs @@ -0,0 +1,34 @@ +using Pubg.Net; +using System.Collections.Generic; + +namespace pubg.net.Tests.Util +{ + //Far from ideal but the only way I can think of + public static class KnownPlayers + { + public static Dictionary KnownPlayerNames = new Dictionary + { + { + PubgRegion.PCEurope, + new string[] + { + "jebuzjack", + "dutsization", + "irishdiablo", + "chmcl08" + } + } + }; + + public static Dictionary KnownPlayerIds = new Dictionary + { + { + PubgRegion.PCEurope, + new string[] + { + "account.dbe0812874d642f7be09814cfb92c89a" + } + } + }; + } +} diff --git a/test/pubg-dotnet.Tests/Util/Values.cs b/test/pubg-dotnet.Tests/Util/Values.cs new file mode 100644 index 0000000..e3891e2 --- /dev/null +++ b/test/pubg-dotnet.Tests/Util/Values.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; + +namespace pubg.net.Tests +{ + public static class Values + { + public static string ApiKey => Environment.GetEnvironmentVariable("PUBG_API_KEY"); + public static Dictionary Items { get; set; } + } +} diff --git a/test/pubg-dotnet.Tests/pubg-dotnet.Tests.csproj b/test/pubg-dotnet.Tests/pubg-dotnet.Tests.csproj index 9f5c4f4..24181d9 100644 --- a/test/pubg-dotnet.Tests/pubg-dotnet.Tests.csproj +++ b/test/pubg-dotnet.Tests/pubg-dotnet.Tests.csproj @@ -1,7 +1,24 @@ - netstandard2.0 + netcoreapp2.0 + pubg.net.Tests + + + + + + + + + + + + + + + + From 36b3a32fc21caab63cef861999511650a6c0788e Mon Sep 17 00:00:00 2001 From: Gavin Power Date: Wed, 11 Apr 2018 04:30:24 +0100 Subject: [PATCH 02/11] Removed some unnecessary usings --- src/pubg-dotnet/Infrastructure/HttpRequestor.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/pubg-dotnet/Infrastructure/HttpRequestor.cs b/src/pubg-dotnet/Infrastructure/HttpRequestor.cs index f27f25e..1e059ed 100644 --- a/src/pubg-dotnet/Infrastructure/HttpRequestor.cs +++ b/src/pubg-dotnet/Infrastructure/HttpRequestor.cs @@ -1,11 +1,7 @@ using Pubg.Net.Exceptions; -using System; -using System.IO; -using System.IO.Compression; using System.Net; using System.Net.Http; using System.Net.Http.Headers; -using System.Text; using System.Threading; using System.Threading.Tasks; From e99295314b380f1a147eef32cc7cda21e72ee7ea Mon Sep 17 00:00:00 2001 From: Gavin Power Date: Wed, 11 Apr 2018 04:30:55 +0100 Subject: [PATCH 03/11] Added the new Japan region --- src/pubg-dotnet/Models/Common/Region.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pubg-dotnet/Models/Common/Region.cs b/src/pubg-dotnet/Models/Common/Region.cs index 8f1c4fd..fa8283d 100644 --- a/src/pubg-dotnet/Models/Common/Region.cs +++ b/src/pubg-dotnet/Models/Common/Region.cs @@ -31,7 +31,10 @@ public enum PubgRegion PCKakao, //What? [EnumMember(Value = "pc-krjp")] - PCKoreaJapan, + PCKorea, + + [EnumMember(Value = "pc-jp")] + PCJapan, [EnumMember(Value = "pc-na")] PCNorthAmerica, From 5cb4173fe7e9541a04efff917dd9fb043e733301 Mon Sep 17 00:00:00 2001 From: Gavin Power Date: Wed, 11 Apr 2018 20:00:51 +0100 Subject: [PATCH 04/11] fixed incorrect path in appveyor --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 25ff1b6..cdff820 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -32,7 +32,7 @@ after_build: test_script: - ps: Write-Host $("Starting tests") - - dotnet test src\pubg-dotnet.Tests\pubg-dotnet.Tests.csproj + - dotnet test test\pubg-dotnet.Tests\pubg-dotnet.Tests.csproj artifacts: - path: '**\*.nupkg' \ No newline at end of file From dfd672291740da1f1d29c183a920fcd76128dd10 Mon Sep 17 00:00:00 2001 From: Gavin Power Date: Wed, 11 Apr 2018 20:01:15 +0100 Subject: [PATCH 05/11] Added basic tests --- test/pubg-dotnet.Tests/Matches/MatchTests.cs | 45 ++++++++++++++ test/pubg-dotnet.Tests/Players/PlayerTests.cs | 59 +++---------------- test/pubg-dotnet.Tests/Status/StatusTests.cs | 20 +++++++ .../Telemetry/TelemetryTests.cs | 23 ++++++++ test/pubg-dotnet.Tests/Util/KnownPlayers.cs | 9 +-- test/pubg-dotnet.Tests/Util/Storage.cs | 51 ++++++++++++++++ test/pubg-dotnet.Tests/Util/Values.cs | 11 ---- .../pubg-dotnet.Tests.csproj | 5 -- 8 files changed, 151 insertions(+), 72 deletions(-) create mode 100644 test/pubg-dotnet.Tests/Matches/MatchTests.cs create mode 100644 test/pubg-dotnet.Tests/Status/StatusTests.cs create mode 100644 test/pubg-dotnet.Tests/Telemetry/TelemetryTests.cs create mode 100644 test/pubg-dotnet.Tests/Util/Storage.cs delete mode 100644 test/pubg-dotnet.Tests/Util/Values.cs diff --git a/test/pubg-dotnet.Tests/Matches/MatchTests.cs b/test/pubg-dotnet.Tests/Matches/MatchTests.cs new file mode 100644 index 0000000..93f456a --- /dev/null +++ b/test/pubg-dotnet.Tests/Matches/MatchTests.cs @@ -0,0 +1,45 @@ +using FluentAssertions; +using Pubg.Net.Tests.Util; +using Pubg.Net.Extensions; +using System.Linq; +using Xunit; +using Pubg.Net.Exceptions; +using System; + +namespace Pubg.Net.Tests.Matches +{ + public class MatchTests + { + [Fact] + public void Can_Retrieve_Match() + { + var region = PubgRegion.PCEurope; + var player = Storage.GetPlayer(region); + var matchService = new PubgMatchService(Storage.ApiKey); + + var match = matchService.GetMatch(region, player.MatchIds.FirstOrDefault()); + + match.ShardId.Should().Equals(region.Serialize()); + match.Rosters.Should().NotBeNull(); + + var participants = match.Rosters.SelectMany(x => x.Participants); + + participants.Should().NotBeNullOrEmpty(); + + var matchPlayer = participants.FirstOrDefault(p => p.Stats.PlayerId == player.Id); + + matchPlayer.Should().NotBeNull(); + matchPlayer.Stats.Name.Should().Equals(player.Name); + + Assert.All(participants, p => p.Stats.Should().NotBeNull()); + 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() + { + Assert.Throws(() => new PubgMatchService(Storage.ApiKey).GetMatch(PubgRegion.PCEurope, Guid.Empty.ToString())); + } + } +} diff --git a/test/pubg-dotnet.Tests/Players/PlayerTests.cs b/test/pubg-dotnet.Tests/Players/PlayerTests.cs index f3fb526..15f9ae7 100644 --- a/test/pubg-dotnet.Tests/Players/PlayerTests.cs +++ b/test/pubg-dotnet.Tests/Players/PlayerTests.cs @@ -1,18 +1,18 @@ -using pubg.net.Tests.Util; +using Pubg.Net.Tests.Util; using Pubg.Net; using Pubg.Net.Exceptions; using System.Linq; using System.Threading.Tasks; using Xunit; -namespace pubg.net.Tests.Players +namespace Pubg.Net.Tests.Players { public class PlayerTests { [Fact] - public void Can_Get_Players_ByName_Sync() + public void Can_Get_Players_ByName() { - var playerService = new PubgPlayerService(Values.ApiKey); + var playerService = new PubgPlayerService(Storage.ApiKey); KnownPlayers.KnownPlayerNames.TryGetValue(PubgRegion.PCEurope, out string[] playerNames); @@ -28,27 +28,9 @@ public void Can_Get_Players_ByName_Sync() } [Fact] - public async Task Can_Get_Players_ByName_Async() + public void Can_Get_Players_ById() { - var playerService = new PubgPlayerService(Values.ApiKey); - - KnownPlayers.KnownPlayerNames.TryGetValue(PubgRegion.PCEurope, out string[] playerNames); - - var filter = new GetPubgPlayersRequest - { - PlayerNames = playerNames - }; - - var players = await playerService.GetPlayersAsync(PubgRegion.PCEurope, filter); - - Assert.NotEmpty(players); - Assert.All(players.Select(p => p.Name), name => playerNames.Contains(name)); - } - - [Fact] - public void Can_Get_Players_ById_Sync() - { - var playerService = new PubgPlayerService(Values.ApiKey); + var playerService = new PubgPlayerService(Storage.ApiKey); KnownPlayers.KnownPlayerIds.TryGetValue(PubgRegion.PCEurope, out string[] playerIds); @@ -63,28 +45,10 @@ public void Can_Get_Players_ById_Sync() Assert.All(players.Select(p => p.Id), id => playerIds.Contains(id)); } - [Fact] - public async Task Can_Get_Players_ById_Async() - { - var playerService = new PubgPlayerService(Values.ApiKey); - - KnownPlayers.KnownPlayerIds.TryGetValue(PubgRegion.PCEurope, out string[] playerIds); - - var filter = new GetPubgPlayersRequest - { - PlayerIds = playerIds - }; - - var players = await playerService.GetPlayersAsync(PubgRegion.PCEurope, filter); - - Assert.NotEmpty(players); - Assert.All(players.Select(p => p.Id), id => playerIds.Contains(id)); - } - [Fact] public void GetPlayers_Throws_Exception_When_NotFound() { - var playerService = new PubgPlayerService(Values.ApiKey); + var playerService = new PubgPlayerService(Storage.ApiKey); var filter = new GetPubgPlayersRequest { @@ -93,14 +57,5 @@ public void GetPlayers_Throws_Exception_When_NotFound() Assert.Throws(() => playerService.GetPlayers(PubgRegion.PCEurope, filter)); } - - [Fact] - public void GetPlayer_Throws_Exception_When_NotFound() - { - var playerService = new PubgPlayerService(Values.ApiKey); - - Assert.Throws(() => playerService.GetPlayer(PubgRegion.PCEurope, "account.00000000000000000000")); - } - } } diff --git a/test/pubg-dotnet.Tests/Status/StatusTests.cs b/test/pubg-dotnet.Tests/Status/StatusTests.cs new file mode 100644 index 0000000..64d305b --- /dev/null +++ b/test/pubg-dotnet.Tests/Status/StatusTests.cs @@ -0,0 +1,20 @@ +using FluentAssertions; +using Pubg.Net.Tests.Util; +using Pubg.Net; +using Xunit; + +namespace Pubg.Net.Tests.Status +{ + public class StatusTests + { + [Fact] + public void Can_Retrieve_Status() + { + var status = new PubgStatusService(Storage.ApiKey).GetStatus(); + + status.Attributes.Should().NotBeNull(); + status.Attributes.Version.Should().NotBeNullOrWhiteSpace(); + status.Id.Should().NotBeNullOrWhiteSpace(); + } + } +} diff --git a/test/pubg-dotnet.Tests/Telemetry/TelemetryTests.cs b/test/pubg-dotnet.Tests/Telemetry/TelemetryTests.cs new file mode 100644 index 0000000..f31901c --- /dev/null +++ b/test/pubg-dotnet.Tests/Telemetry/TelemetryTests.cs @@ -0,0 +1,23 @@ +using FluentAssertions; +using Pubg.Net.Tests.Util; +using Pubg.Net; +using System.Linq; +using Xunit; + +namespace Pubg.Net.Tests.Telemetry +{ + public class TelemetryTests + { + [Fact] + public void Can_Pull_Telemetry_From_Match() + { + var match = Storage.GetMatch(PubgRegion.PCEurope); + var asset = match.Assets.FirstOrDefault(); + var telemetryService = new PubgTelemetryService(); + + var telemetry = telemetryService.GetTelemetry(PubgRegion.PCEurope, asset); + + telemetry.Should().NotBeEmpty(); + } + } +} diff --git a/test/pubg-dotnet.Tests/Util/KnownPlayers.cs b/test/pubg-dotnet.Tests/Util/KnownPlayers.cs index d289ad8..ff30517 100644 --- a/test/pubg-dotnet.Tests/Util/KnownPlayers.cs +++ b/test/pubg-dotnet.Tests/Util/KnownPlayers.cs @@ -1,9 +1,9 @@ using Pubg.Net; using System.Collections.Generic; -namespace pubg.net.Tests.Util +namespace Pubg.Net.Tests.Util { - //Far from ideal but the only way I can think of + //Far from ideal but there is no way to query a list of players public static class KnownPlayers { public static Dictionary KnownPlayerNames = new Dictionary @@ -13,7 +13,7 @@ public static class KnownPlayers new string[] { "jebuzjack", - "dutsization", + "Dutsization", "irishdiablo", "chmcl08" } @@ -26,7 +26,8 @@ public static class KnownPlayers PubgRegion.PCEurope, new string[] { - "account.dbe0812874d642f7be09814cfb92c89a" + "account.dbe0812874d642f7be09814cfb92c89a", + "account.e9548dfdc07847b29bb51cbcc0b4cde7" } } }; diff --git a/test/pubg-dotnet.Tests/Util/Storage.cs b/test/pubg-dotnet.Tests/Util/Storage.cs new file mode 100644 index 0000000..04bb393 --- /dev/null +++ b/test/pubg-dotnet.Tests/Util/Storage.cs @@ -0,0 +1,51 @@ +using Pubg.Net; +using Pubg.Net.Extensions; +using Pubg.Net.Models.Base; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Pubg.Net.Tests.Util +{ + public static class Storage + { + static Storage() + { + StoredItems = new List(); + } + + public static string ApiKey => Environment.GetEnvironmentVariable("PUBG_API_KEY"); + public static List StoredItems { get; set; } + + public static PubgPlayer GetPlayer(PubgRegion region) + { + var player = StoredItems.OfType().FirstOrDefault(p => p.ShardId == region.Serialize()); + + if (player != null) + return player; + + var playerService = new PubgPlayerService(ApiKey); + var knownPlayerNames = KnownPlayers.KnownPlayerNames.FirstOrDefault(p => p.Key == region); + var players = playerService.GetPlayers(knownPlayerNames.Key, new GetPubgPlayersRequest { PlayerNames = knownPlayerNames.Value }); + + StoredItems.AddRange(players); + + return players.FirstOrDefault(); + } + + public static PubgMatch GetMatch(PubgRegion region) + { + var match = StoredItems.OfType().FirstOrDefault(p => p.ShardId == region.Serialize()); + + if (match != null) + return match; + + var player = GetPlayer(region); + match = new PubgMatchService(ApiKey).GetMatch(region, player.MatchIds.First()); + + StoredItems.Add(match); + + return match; + } + } +} diff --git a/test/pubg-dotnet.Tests/Util/Values.cs b/test/pubg-dotnet.Tests/Util/Values.cs deleted file mode 100644 index e3891e2..0000000 --- a/test/pubg-dotnet.Tests/Util/Values.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace pubg.net.Tests -{ - public static class Values - { - public static string ApiKey => Environment.GetEnvironmentVariable("PUBG_API_KEY"); - public static Dictionary Items { get; set; } - } -} diff --git a/test/pubg-dotnet.Tests/pubg-dotnet.Tests.csproj b/test/pubg-dotnet.Tests/pubg-dotnet.Tests.csproj index 24181d9..12f5cb8 100644 --- a/test/pubg-dotnet.Tests/pubg-dotnet.Tests.csproj +++ b/test/pubg-dotnet.Tests/pubg-dotnet.Tests.csproj @@ -5,11 +5,6 @@ pubg.net.Tests - - - - - From 7845d08c21714eaa304d3880da722d7dfc2a3ed8 Mon Sep 17 00:00:00 2001 From: Gavin Power Date: Wed, 11 Apr 2018 20:01:34 +0100 Subject: [PATCH 06/11] Updated participant model --- .../Models/Participants/PubgMatchPlayer.cs | 17 ----------------- .../Models/Participants/PubgParticipant.cs | 3 --- .../Models/Participants/PubgParticipantStats.cs | 12 ++++++------ 3 files changed, 6 insertions(+), 26 deletions(-) delete mode 100644 src/pubg-dotnet/Models/Participants/PubgMatchPlayer.cs diff --git a/src/pubg-dotnet/Models/Participants/PubgMatchPlayer.cs b/src/pubg-dotnet/Models/Participants/PubgMatchPlayer.cs deleted file mode 100644 index 3337fba..0000000 --- a/src/pubg-dotnet/Models/Participants/PubgMatchPlayer.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Newtonsoft.Json; -using Pubg.Net.Models.Base; - -namespace Pubg.Net -{ - public class PubgMatchPlayer : PubgEntity - { - [JsonProperty] - public string Name { get; set; } - - [JsonProperty] - public string PatchVersion { get; set; } - - [JsonProperty] - public string TitleId { get; set; } - } -} diff --git a/src/pubg-dotnet/Models/Participants/PubgParticipant.cs b/src/pubg-dotnet/Models/Participants/PubgParticipant.cs index 994023d..ef2ad2f 100644 --- a/src/pubg-dotnet/Models/Participants/PubgParticipant.cs +++ b/src/pubg-dotnet/Models/Participants/PubgParticipant.cs @@ -10,8 +10,5 @@ public class PubgParticipant : PubgShardedEntity [JsonProperty] public string Actor { get; set; } - - [JsonProperty] - public PubgMatchPlayer Player { get; set; } } } diff --git a/src/pubg-dotnet/Models/Participants/PubgParticipantStats.cs b/src/pubg-dotnet/Models/Participants/PubgParticipantStats.cs index cfaed47..0c2bf89 100644 --- a/src/pubg-dotnet/Models/Participants/PubgParticipantStats.cs +++ b/src/pubg-dotnet/Models/Participants/PubgParticipantStats.cs @@ -4,6 +4,12 @@ namespace Pubg.Net { public class PubgParticipantStats { + [JsonProperty] + public string Name { get; set; } + + [JsonProperty] + public string PlayerId { get; set; } + [JsonProperty("DBNOs")] public int DBNOs { get; set; } @@ -49,12 +55,6 @@ public class PubgParticipantStats [JsonProperty] public int MostDamage { get; set; } - [JsonProperty] - public string Name { get; set; } - - [JsonProperty] - public string PlayerId { get; set; } - [JsonProperty] public int Revives { get; set; } From 04038962c54e8a5ee1c7ba18ea6ab532220402d7 Mon Sep 17 00:00:00 2001 From: Gavin Power Date: Wed, 11 Apr 2018 20:12:39 +0100 Subject: [PATCH 07/11] Removed nuget package on build --- src/pubg-dotnet/pubg-dotnet.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pubg-dotnet/pubg-dotnet.csproj b/src/pubg-dotnet/pubg-dotnet.csproj index 2239ac1..aa8fc10 100644 --- a/src/pubg-dotnet/pubg-dotnet.csproj +++ b/src/pubg-dotnet/pubg-dotnet.csproj @@ -17,7 +17,7 @@ netstandard2.0 Pubg.Net - true + false Pubg.Net From ae7071550a061bb949378e2a2c67bc70ba0fc630 Mon Sep 17 00:00:00 2001 From: Gavin Power Date: Wed, 11 Apr 2018 20:36:01 +0100 Subject: [PATCH 08/11] Updated readme with appveyor badge --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e9c1a3..7a2f6e3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ ![PUBG Developer API Logo](https://developer.playbattlegrounds.com/d3fa01d31345504b60eacea226638a02.png) -# Pubg-DotNet +# Pubg-DotNet [![Build status](https://ci.appveyor.com/api/projects/status/w3vk9q4avelqpgcp?svg=true)](https://ci.appveyor.com/project/GavinPower747/pubg-dotnet) + A sync/async client library for communicating with the Pubg developer api. Supporting .Net Standard 2.0. Contact GavinPower747 on the Pubg Api Discord for more details From 224f36c5d75160584926d73c353c1b347407526d Mon Sep 17 00:00:00 2001 From: Gavin Power Date: Wed, 11 Apr 2018 20:37:40 +0100 Subject: [PATCH 09/11] Bumped version to 1.0.1 --- src/pubg-dotnet/pubg-dotnet.csproj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pubg-dotnet/pubg-dotnet.csproj b/src/pubg-dotnet/pubg-dotnet.csproj index aa8fc10..2c09d98 100644 --- a/src/pubg-dotnet/pubg-dotnet.csproj +++ b/src/pubg-dotnet/pubg-dotnet.csproj @@ -3,8 +3,7 @@ Sync and Async client library for communicating with the Pubg Developer API supporting .net standard 2.0 Pubg.Net - 0.7 - 1.0 + 1.0.1 Gavin Power netstandard2.0;net45 Pubg.Net From 64b43dab2b24fb33e8c673c2c2ff36002270016a Mon Sep 17 00:00:00 2001 From: Gavin Power Date: Wed, 11 Apr 2018 21:01:28 +0100 Subject: [PATCH 10/11] Added automatic github release --- appveyor.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index cdff820..b4af22b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,6 @@ version: 1.0.0.{build} image: Visual Studio 2017 +skip_tags: true environment: PUBG_API_KEY: @@ -12,6 +13,19 @@ deploy: on: branch: master +- provider: Github + release: Pubg.Net-v$(appveyor_build_version) + description: 'Release of $(appveyor_build_version)' + provider: GitHub + auth_token: + secure: 6bQdMR64k8Hsx3yyvLjkfD9K16vBFYQg85PqD5tAypkcBRe8cSsofZAgavw1QrVm + artifact: /.*\.nupkg/ # upload all NuGet packages to release assets + draft: false + prerelease: false + on: + branch: master # release from master branch only + + before_build: - dotnet --info - ps: Write-Host $("Performing Dot Net Restore") From de11d8394d17555b517f5754344874a0f742adb4 Mon Sep 17 00:00:00 2001 From: Gavin Power Date: Wed, 11 Apr 2018 21:04:50 +0100 Subject: [PATCH 11/11] Duplicate key --- appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index b4af22b..afd668a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,7 +16,6 @@ deploy: - provider: Github release: Pubg.Net-v$(appveyor_build_version) description: 'Release of $(appveyor_build_version)' - provider: GitHub auth_token: secure: 6bQdMR64k8Hsx3yyvLjkfD9K16vBFYQg85PqD5tAypkcBRe8cSsofZAgavw1QrVm artifact: /.*\.nupkg/ # upload all NuGet packages to release assets