Skip to content

Commit

Permalink
Test that install identifier=version works
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed May 20, 2019
1 parent ce93506 commit 90e1a50
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion Tests/Core/ModuleInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,41 @@ public void CanInstallMod()
}
}

[Test]
public void InstallList_IdentifierEqualsVersionSyntax_InstallsModule()
{
using (DisposableKSP ksp = new DisposableKSP())
{
// Arrange
KSPManager manager = new KSPManager(
new NullUser(),
new FakeWin32Registry(ksp.KSP, ksp.KSP.Name)
) {
CurrentInstance = ksp.KSP
};
var registry = CKAN.RegistryManager.Instance(ksp.KSP).registry;
var inst = CKAN.ModuleInstaller.GetInstance(ksp.KSP, manager.Cache, nullUser);

const string mod_file_name = "DogeCoinFlag/Flags/dogecoin.png";
string mod_file_path = Path.Combine(ksp.KSP.GameData(), mod_file_name);
CkanModule mod = TestData.DogeCoinFlag_101_module();
registry.AddAvailable(mod);
manager.Cache.Store(mod, TestData.DogeCoinFlagZip());
List<string> modules = new List<string>()
{
$"{mod.identifier}={mod.version}"
};

// Act
inst.InstallList(modules, new RelationshipResolverOptions());

// Assert
Assert.IsTrue(File.Exists(mod_file_path));

manager.Dispose();
}
}

[Test]
public void CanUninstallMod()
{
Expand Down Expand Up @@ -716,7 +751,7 @@ public void AllowInstallsToScenarios()
);
}
}

[Test]
public void SuccessfulReplacement()
{
Expand Down

0 comments on commit 90e1a50

Please sign in to comment.