Skip to content

Commit

Permalink
Upgrade deps, fix several broken tests on main (#2403)
Browse files Browse the repository at this point in the history
  • Loading branch information
halgari authored Dec 17, 2024
1 parent d8a31ae commit a62eeb1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
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

0 comments on commit a62eeb1

Please sign in to comment.