Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BigBang1112 committed Dec 21, 2024
1 parent c90d6fb commit 92bb6ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Text.Json.Serialization;

namespace ManiaAPI.NadeoAPI.JsonContexts;
namespace ManiaAPI.NadeoAPI.Extensions.Gbx;

[JsonSerializable(typeof(MapInfo))]
[JsonSerializable(typeof(MapInfoSubmit))]
[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]
internal sealed partial class NadeoAPIMapInfoJsonContext : JsonSerializerContext;
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private static MultipartFormDataContent CreateContent(BufferedStream bufferedStr

return new MultipartFormDataContent
{
{ JsonContent.Create(mapInfo, NadeoAPIMapInfoJsonContext.Default.MapInfo), "nadeoservices-core-parameters" },
{ JsonContent.Create(mapInfo, NadeoAPIMapInfoJsonContext.Default.MapInfoSubmit), "nadeoservices-core-parameters" },
{ new StreamContent(bufferedStream), "data", fileName }
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Xunit;
using Xunit.Abstractions;

namespace ManiaAPI.TrackmaniaIO.Integration;
namespace ManiaAPI.TrackmaniaIO.Tests.Integration;

public class TrackmaniaIOTests(ITestOutputHelper output)
{
Expand All @@ -20,9 +20,9 @@ public async void RequestManagement()
output.WriteLine("Rate limit remaining after first request: {0}", rateLimitRemainingAfterFirstRequest);

var customCampaign = await trackmaniaIO.GetCustomCampaignAsync(clubId: 21571, campaignId: 5886);

var rateLimitPerRequest = rateLimitRemainingAfterFirstRequest - TrackmaniaIO.RateLimitRemaining;

var officialCampaign = await trackmaniaIO.GetOfficialCampaignAsync(campaignId: 130);
var leaderboard = await trackmaniaIO.GetLeaderboardAsync("3987d489-03ae-4645-9903-8f7679c3a418", "XJ_JEjWGoAexDWe8qfaOjEcq5l8");
var recentWorldRecords = await trackmaniaIO.GetRecentWorldRecordsAsync("3987d489-03ae-4645-9903-8f7679c3a418");
Expand All @@ -38,7 +38,7 @@ public async void RequestManagement()
// Assert
Assert.Null(startingRateLimitRemaining);
Assert.Equal(expected: 1, actual: rateLimitPerRequest);

Assert.IsType<CampaignCollection>(campaigns);
Assert.IsType<Campaign>(customCampaign);
Assert.IsType<Campaign>(officialCampaign);
Expand Down

0 comments on commit 92bb6ea

Please sign in to comment.