Skip to content

Commit

Permalink
Merge pull request #312 from Aragas/dev
Browse files Browse the repository at this point in the history
v5.1.0 #2
  • Loading branch information
Aragas authored Nov 10, 2022
2 parents 5acfb4c + d3f5f8a commit d6e0769
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/Mod Configuration Menu.sln
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{01264F42-8EC3-4920-AF18-FB316F5BFB9A}"
ProjectSection(SolutionItems) = preProject
..\.github\workflows\docfx.yml = ..\.github\workflows\docfx.yml
..\.github\workflows\nexusmods-cookies.yml = ..\.github\workflows\nexusmods-cookies.yml
..\.github\workflows\test-and-publish.yml = ..\.github\workflows\test-and-publish.yml
..\.github\workflows\verify-unex-data.yml = ..\.github\workflows\verify-unex-data.yml
..\.github\workflows\dotnet-format-daily.yml = ..\.github\workflows\dotnet-format-daily.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{560DE987-D9C8-431C-A197-08C925905C24}"
Expand Down
11 changes: 7 additions & 4 deletions tests/MCM.Tests/BaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using System.Runtime.CompilerServices;

using TaleWorlds.Engine;
using TaleWorlds.Library;

using v5::MCM;
using v5::MCM.Internal;
Expand All @@ -23,16 +24,16 @@ namespace MCM.Tests
public class BaseTests
{
[MethodImpl(MethodImplOptions.NoInlining)]
private static bool MockedGetConfigsPath(ref string __result)
private static bool MockedGetModulesNames(ref string[] __result)
{
__result = AppDomain.CurrentDomain.BaseDirectory;
__result = Array.Empty<string>();
return false;
}

[MethodImpl(MethodImplOptions.NoInlining)]
private static bool MockedGetModulesNames(ref string[] __result)
private static bool MockedPlatformFileHelper(ref IPlatformFileHelper __result)
{
__result = Array.Empty<string>();
__result = new PlatformFileHelperPC("");
return false;
}

Expand All @@ -49,6 +50,8 @@ public void OneTimeSetUp()
// prefix: new HarmonyMethod(SymbolExtensions2.GetMethodInfo((IEnumerable<ModuleInfoExtended> x) => MockedGetLoadedModules(ref x))));
_harmony.Patch(SymbolExtensions2.GetMethodInfo(() => Utilities.GetModulesNames()),
prefix: new HarmonyMethod(SymbolExtensions2.GetMethodInfo((string[] x) => MockedGetModulesNames(ref x))));
_harmony.Patch(SymbolExtensions2.GetPropertyGetter(() => Common.PlatformFileHelper),
prefix: new HarmonyMethod(SymbolExtensions2.GetMethodInfo((IPlatformFileHelper x) => MockedPlatformFileHelper(ref x))));

var butterLib = new MBSubModuleBaseWrapper(new ButterLibSubModule());
butterLib.OnSubModuleLoad();
Expand Down

0 comments on commit d6e0769

Please sign in to comment.