Exemple #1
0
        public void AutodetectedCanSatisfyRelationships()
        {
            using (var ksp = new DisposableKSP())
            {
                registry.RegisterPreexistingModule(ksp.KSP, Path.Combine(ksp.KSP.GameData(), "ModuleManager.dll"), new ModInfoJson()
                {
                    name    = "ModuleManager",
                    version = new ModVersion("0.2.3")
                });

                var depends = new List <ModDependency>()
                {
                    new ModDependency("ModuleManager")
                };

                CfanModule mod = generator.GeneratorRandomModule(depends: depends);

                new RelationshipResolver(
                    new CfanModule[] { mod },
                    RelationshipResolver.DefaultOpts(),
                    registry,
                    new FactorioVersion("1.0.0")
                    );
            }
        }
Exemple #2
0
 public void Setup()
 {
     registry  = CKAN.Registry.Empty();
     options   = RelationshipResolver.DefaultOpts();
     generator = new RandomModuleGenerator(new Random(0451));
     //Sanity checker means even incorrect RelationshipResolver logic was passing
     options.without_enforce_consistency = true;
 }
Exemple #3
0
 public void Constructor_WithoutModules_AlwaysReturns()
 {
     registry = Registry.Empty();
     options  = RelationshipResolver.DefaultOpts();
     Assert.DoesNotThrow(() => new RelationshipResolver(new List <string>(),
                                                        options,
                                                        registry));
 }
Exemple #4
0
 public void Constructor_WithoutModules_AlwaysReturns()
 {
     registry = CKAN.Registry.Empty();
     options  = RelationshipResolver.DefaultOpts();
     Assert.DoesNotThrow(() => new RelationshipResolver(new List <CfanModuleIdAndVersion>(),
                                                        options,
                                                        registry,
                                                        null));
 }
Exemple #5
0
        public void AutodetectedCanSatisfyRelationships()
        {
            using (var ksp = new DisposableKSP())
            {
                registry.RegisterDll(ksp.KSP, Path.Combine(ksp.KSP.GameData(), "ModuleManager.dll"));

                var depends = new List <CKAN.RelationshipDescriptor>();
                depends.Add(new CKAN.RelationshipDescriptor {
                    name = "ModuleManager"
                });

                CkanModule mod = generator.GeneratorRandomModule(depends: depends);

                new RelationshipResolver(
                    new CkanModule[] { mod },
                    RelationshipResolver.DefaultOpts(),
                    registry,
                    new KspVersionCriteria(KspVersion.Parse("1.0.0"))
                    );
            }
        }