-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rich presence test and add JsonPropertyName attributes
- Loading branch information
Showing
3 changed files
with
55 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using LBPUnion.Starnet.Types.Entities.RichPresence; | ||
using Xunit; | ||
|
||
namespace LBPUnion.Starnet.Tests.Integration; | ||
|
||
[Trait("Category", "Integration")] | ||
public class RichPresenceRequestTests | ||
{ | ||
private readonly LighthouseClient client = new(); | ||
|
||
[Fact] | ||
public async Task RichPresenceRequests_CanGetRichPresence() | ||
{ | ||
RichPresenceEntity? richPresenceEntity = await this.client.GetRpcConfigurationAsync(); | ||
Assert.NotNull(richPresenceEntity); | ||
Assert.NotNull(richPresenceEntity.Assets); | ||
|
||
Assert.Equal("1060973475151495288", richPresenceEntity.ApplicationId); | ||
Assert.Equal("beacon", richPresenceEntity.PartyIdPrefix); | ||
Assert.Equal("Integer", richPresenceEntity.UsernameType.ToString()); | ||
} | ||
} |
34 changes: 25 additions & 9 deletions
34
Starnet/Types/Entities/RichPresence/RichPresenceAssetsEntity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,33 @@ | ||
using JetBrains.Annotations; | ||
using System.Text.Json.Serialization; | ||
using JetBrains.Annotations; | ||
|
||
namespace LBPUnion.Starnet.Types.Entities.RichPresence; | ||
|
||
[PublicAPI] | ||
[Serializable] | ||
public class RichPresenceAssetsEntity | ||
{ | ||
public bool UseApplicationAssets { get; init; } | ||
public string? PodAsset { get; init; } | ||
public string? MoonAsset { get; init; } | ||
public string? RemoteMoonAsset { get; init; } | ||
public string? DeveloperAsset { get; init; } | ||
public string? DeveloperAdventureAsset { get; init; } | ||
public string? DlcAsset { get; init; } | ||
public string? FallbackAsset { get; init; } | ||
[JsonPropertyName("useApplicationAssets")] | ||
public bool UseApplicationAssets { get; set; } | ||
|
||
[JsonPropertyName("podAsset")] | ||
public string? PodAsset { get; set; } | ||
|
||
[JsonPropertyName("moonAsset")] | ||
public string? MoonAsset { get; set; } | ||
|
||
[JsonPropertyName("remoteMoonAsset")] | ||
public string? RemoteMoonAsset { get; set; } | ||
|
||
[JsonPropertyName("developerAsset")] | ||
public string? DeveloperAsset { get; set; } | ||
|
||
[JsonPropertyName("developerAdventureAsset")] | ||
public string? DeveloperAdventureAsset { get; set; } | ||
|
||
[JsonPropertyName("dlcAsset")] | ||
public string? DlcAsset { get; set; } | ||
|
||
[JsonPropertyName("fallbackAsset")] | ||
public string? FallbackAsset { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters