public void Registry_ZeroByteRegistryJson_EmptyRegistryWithoutCrash() { // Arrange string registryPath = TestData.DataDir("zero-byte-registry.json"); DisposableKSP dispksp; CKAN.GameInstance ksp; // Act dispksp = new DisposableKSP(null, registryPath); ksp = dispksp.KSP; // Assert CKAN.Registry reg = CKAN.RegistryManager.Instance(ksp).registry; Assert.IsNotNull(reg); // These lists should all be empty, copied from CKAN.Registry.Empty() Assert.IsFalse(reg.InstalledModules.Any()); Assert.IsFalse(reg.InstalledDlls.Any()); Assert.IsFalse(reg.HasAnyAvailable()); // installed_files isn't exposed for testing // A default repo is set during load Assert.IsTrue(reg.Repositories.Any()); dispksp.Dispose(); }
public void Setup() { // Make a fake KSP install temp_ksp = new Tests.DisposableKSP(null, test_registry); // Easy short-cut registry = temp_ksp.KSP.Registry; }
public void UpdateRegistry() { CKAN.Registry registry = CKAN.Registry.Empty(); CKAN.Repo.UpdateRegistry(TestData.TestKAN(), registry); // Test we've got an expected module. CKAN.CkanModule far = registry.LatestAvailable("FerramAerospaceResearch", new CKAN.KSPVersion("0.25.0")); Assert.AreEqual("v0.14.3.2", far.version.ToString()); }
public void Empty() { CKAN.Registry registry = CKAN.Registry.Empty(); Assert.IsInstanceOf <CKAN.Registry>(registry); }
public void Setup() { // Provide an empty registry before each test. registry = CKAN.Registry.Empty(); Assert.IsNotNull(registry); }
public void Setup() { // Provide an empty registry before each test. registry = CKAN.Registry.Empty(); Assert.IsNotNull(registry); }