public void GetListings_NoCreationClub() { using var tmp = Utility.GetTempFolder(nameof(LoadOrder_Tests)); var pluginsPath = Path.Combine(tmp.Dir.Path, "Plugins.txt"); var dataPath = Path.Combine(tmp.Dir.Path, "Data"); File.WriteAllLines(pluginsPath, new string[] { $"{Utility.MasterModKey.FileName}", $"{Utility.PluginModKey.FileName}", }); Directory.CreateDirectory(dataPath); File.WriteAllText(Path.Combine(dataPath, Utility.MasterModKey.FileName), string.Empty); File.WriteAllText(Path.Combine(dataPath, Utility.PluginModKey.FileName), string.Empty); var results = LoadOrder.GetListings( game: GameRelease.Oblivion, dataPath: dataPath, pluginsFilePath: pluginsPath, creationClubFilePath: null) .ToList(); results.Should().HaveCount(2); results.Should().Equal(new LoadOrderListing[] { new LoadOrderListing(Utility.MasterModKey, enabled: true), new LoadOrderListing(Utility.PluginModKey, enabled: true), }); }
public void GetListings_VortexCreationClub() { using var tmp = Utility.GetTempFolder(nameof(LoadOrder_Tests)); var cccPath = Path.Combine(tmp.Dir.Path, "Skyrim.ccc"); var pluginsPath = Path.Combine(tmp.Dir.Path, "Plugins.txt"); var dataPath = Path.Combine(tmp.Dir.Path, "Data"); File.WriteAllLines(cccPath, new string[] { Utility.LightMasterModKey.FileName, Utility.LightMasterModKey2.FileName, }); File.WriteAllLines(pluginsPath, new string[] { Utility.LightMasterModKey2.FileName, Utility.LightMasterModKey.FileName, $"*{Utility.MasterModKey.FileName}", $"{Utility.MasterModKey2.FileName}", $"*{Utility.LightMasterModKey3.FileName}", $"{Utility.LightMasterModKey4.FileName}", $"*{Utility.PluginModKey.FileName}", $"{Utility.PluginModKey2.FileName}", }); Directory.CreateDirectory(dataPath); File.WriteAllText(Path.Combine(dataPath, Utility.LightMasterModKey.FileName), string.Empty); File.WriteAllText(Path.Combine(dataPath, Utility.LightMasterModKey2.FileName), string.Empty); File.WriteAllText(Path.Combine(dataPath, Utility.MasterModKey.FileName), string.Empty); File.WriteAllText(Path.Combine(dataPath, Utility.MasterModKey2.FileName), string.Empty); File.WriteAllText(Path.Combine(dataPath, Utility.LightMasterModKey3.FileName), string.Empty); File.WriteAllText(Path.Combine(dataPath, Utility.LightMasterModKey4.FileName), string.Empty); File.WriteAllText(Path.Combine(dataPath, Utility.PluginModKey.FileName), string.Empty); File.WriteAllText(Path.Combine(dataPath, Utility.PluginModKey2.FileName), string.Empty); var results = LoadOrder.GetListings( game: GameRelease.SkyrimSE, dataPath: dataPath, pluginsFilePath: pluginsPath, creationClubFilePath: cccPath) .ToList(); results.Should().HaveCount(8); results.Should().Equal(new LoadOrderListing[] { new LoadOrderListing(Utility.LightMasterModKey2, enabled: true), new LoadOrderListing(Utility.LightMasterModKey, enabled: true), new LoadOrderListing(Utility.MasterModKey, enabled: true), new LoadOrderListing(Utility.MasterModKey2, enabled: false), new LoadOrderListing(Utility.LightMasterModKey3, enabled: true), new LoadOrderListing(Utility.LightMasterModKey4, enabled: false), new LoadOrderListing(Utility.PluginModKey, enabled: true), new LoadOrderListing(Utility.PluginModKey2, enabled: false), }); }
public void GetListings_CreationClubMissing() { using var tmp = TestPathing.GetTempFolder(nameof(LoadOrderIntegrationTests)); var cccPath = Path.Combine(tmp.Dir.Path, "Skyrim.ccc"); var pluginsPath = Path.Combine(tmp.Dir.Path, "Plugins.txt"); var dataPath = Path.Combine(tmp.Dir.Path, "Data"); File.WriteAllLines(pluginsPath, new string[] { $"*{TestConstants.MasterModKey.FileName}", $"{TestConstants.MasterModKey2.FileName}", $"*{TestConstants.LightMasterModKey3.FileName}", $"{TestConstants.LightMasterModKey4.FileName}", $"*{TestConstants.PluginModKey.FileName}", $"{TestConstants.PluginModKey2.FileName}", }); Directory.CreateDirectory(dataPath); File.WriteAllText(Path.Combine(dataPath, TestConstants.MasterModKey.FileName), string.Empty); File.WriteAllText(Path.Combine(dataPath, TestConstants.MasterModKey2.FileName), string.Empty); File.WriteAllText(Path.Combine(dataPath, TestConstants.LightMasterModKey3.FileName), string.Empty); File.WriteAllText(Path.Combine(dataPath, TestConstants.LightMasterModKey4.FileName), string.Empty); File.WriteAllText(Path.Combine(dataPath, TestConstants.PluginModKey.FileName), string.Empty); File.WriteAllText(Path.Combine(dataPath, TestConstants.PluginModKey2.FileName), string.Empty); var results = LoadOrder.GetListings( game: GameRelease.SkyrimSE, dataPath: dataPath, pluginsFilePath: pluginsPath, creationClubFilePath: cccPath) .ToList(); results.Should().HaveCount(6); results.Should().Equal(new ModListing[] { new ModListing(TestConstants.MasterModKey, enabled: true), new ModListing(TestConstants.MasterModKey2, enabled: false), new ModListing(TestConstants.LightMasterModKey3, enabled: true), new ModListing(TestConstants.LightMasterModKey4, enabled: false), new ModListing(TestConstants.PluginModKey, enabled: true), new ModListing(TestConstants.PluginModKey2, enabled: false), }); }