Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bcssov committed Jul 25, 2022
1 parent 53206e1 commit c0f1892
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/IronyModManager.Services.Tests/ModMergeServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
using IronyModManager.Services.Common;
using IronyModManager.Shared;
using IronyModManager.Shared.Cache;
using IronyModManager.Shared.Configuration;
using IronyModManager.Shared.MessageBus;
using IronyModManager.Shared.Models;
using IronyModManager.Storage.Common;
Expand Down Expand Up @@ -338,6 +339,7 @@ public async Task Should_create_merge_compress_mods()
{
return false;
});
DISetup.Container.Register<IDomainConfiguration>(() => new DomainConfigDummy(true));


var service = new ModMergeService(null, compressExporter.Object, new Cache(), messageBus.Object, modPatchExporter.Object, modMergeExporter.Object,
Expand Down Expand Up @@ -584,5 +586,35 @@ public async Task Should_not_have_free_space_to_create_merge_mod()

result.Should().BeFalse();
}

/// <summary>
/// Class DomainConfigDummy.
/// Implements the <see cref="IDomainConfiguration" />
/// </summary>
/// <seealso cref="IDomainConfiguration" />
private class DomainConfigDummy : Shared.Configuration.IDomainConfiguration
{
/// <summary>
/// The domain
/// </summary>
DomainConfigurationOptions domain = new DomainConfigurationOptions();
/// <summary>
/// Initializes a new instance of the <see cref="DomainConfigDummy"/> class.
/// </summary>
/// <param name="useLegacySteamLaunch">if set to <c>true</c> [use legacy steam launch].</param>
public DomainConfigDummy(bool useLegacySteamLaunch)
{
domain.Steam.UseLegacyLaunchMethod = useLegacySteamLaunch;
}

/// <summary>
/// Gets the options.
/// </summary>
/// <returns>DomainConfigurationOptions.</returns>
public DomainConfigurationOptions GetOptions()
{
return domain;
}
}
}
}

0 comments on commit c0f1892

Please sign in to comment.