Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade deps, fix several broken tests on main #2403

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="NSubstitute" Version="5.3.0" />
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.17">
<PrivateAssets>all</PrivateAssets>
Expand All @@ -128,7 +128,7 @@
<PackageVersion Include="BitFaster.Caching" Version="2.5.2" />
<PackageVersion Include="CliWrap" Version="3.6.7" />
<PackageVersion Include="DynamicData" Version="9.0.4" />
<PackageVersion Include="GameFinder" Version="4.3.3" />
<PackageVersion Include="GameFinder" Version="4.4.0" />
<PackageVersion Include="Humanizer" Version="2.14.1" />
<PackageVersion Include="ini-parser-netstandard" Version="2.5.2" />
<PackageVersion Include="Mutagen.Bethesda.Skyrim" Version="0.44.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ public enum ModSourceType
/// <summary>
/// Downloaded externally via an URL.
/// </summary>
[JsonStringEnumMemberName("Browse")]
[JsonStringEnumMemberName("browse")]
Browse,

/// <summary>
/// Downloaded externally via an URL.
/// </summary>
[JsonStringEnumMemberName("Direct")]
[JsonStringEnumMemberName("direct")]
Direct,
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public sealed class LoginManager : IDisposable, ILoginManager
public Observable<UserInfo?> UserInfoObservable => _userInfo;

/// <inheritdoc/>
public UserInfo? UserInfo { get; private set; }
public UserInfo? UserInfo => _cachedUserInfo.Get();

private readonly IDisposable _observeDatomDisposable;

Expand Down Expand Up @@ -61,18 +61,16 @@ public LoginManager(
.DistinctUntilChanged()
.SubscribeAwait(async (hasValue, cancellationToken) =>
{
_cachedUserInfo.Evict();

if (!hasValue)
{
_cachedUserInfo.Evict();
_userInfo.OnNext(value: null);
UserInfo = null;
}
else
{
var userInfo = await Verify(cancellationToken);
_cachedUserInfo.Store(userInfo);
_userInfo.OnNext(userInfo);
UserInfo = userInfo;
}
}, awaitOperation: AwaitOperation.Sequential, configureAwait: false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public async Task CanInstallCollections(string slug, int revisionNumber)
var loginManager = ServiceProvider.GetRequiredService<ILoginManager>();
_ = await loginManager.GetUserInfoAsync();

loginManager.UserInfo.Should().NotBeNull(because: "this test requires a logged in user");
loginManager.IsPremium.Should().BeTrue(because: "this test requires premium to automatically download mods");

await using var destination = TemporaryFileManager.CreateFile();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static IServiceCollection AddStubbedGameLocators(this IServiceCollection

coll.AddSingleton<AHandler<GOGGame, GOGGameId>>(s =>
new StubbedGameLocator<GOGGame, GOGGameId>(s.GetRequiredService<TemporaryFileManager>(),
tfm => new GOGGame(GOGGameId.From(42), "Stubbed Game", tfm.CreateFolder("gog_game").Path),
tfm => new GOGGame(GOGGameId.From(42), "Stubbed Game", tfm.CreateFolder("gog_game").Path, "4242"),
game => game.Id));

coll.AddSingleton<AHandler<SteamGame, AppId>>(s =>
Expand Down
Loading