Beispiel #1
0
        public void Setup()
        {
            cm       = new XmlConfigManager(Resources.TestDirectory, Resources.ConfigFile);
            database = new DbIndexPersistence(cm);
            string dbName = cm.GetItemByName("NextDatabase");

            string connStr =
                $"server={Environment.GetEnvironmentVariable("DB_HOST")};" +
                $"user={Environment.GetEnvironmentVariable("DB_USER")};" +
                $"database={dbName};port=3306;" +
                $"password={Environment.GetEnvironmentVariable("DB_PWD")}";

            conn = new MySqlConnection(connStr);

            tagLinks.Add(tag1, new List <string>()
            {
                "1.png", "2.png", "3.jpg"
            });
            tagLinks.Add(tag2, new List <string>()
            {
                "3.jpg", "4.png"
            });
            tagLinks.Add(tag3, new List <string>()
            {
                "6.png"
            });

            seriesTags.Add(series, new HashSet <string>()
            {
                tag1, tag2
            });
        }
        public void TestDownload()
        {
            IPersistenceManager pm     = new FolderImageManager();
            IConfigManager      cm     = new XmlConfigManager(Resources.TestDirectory, Resources.ConfigFile);
            TestDownloader      testDL = new TestDownloader(pm, cm);

            testDL.Download(Resources.ImageCmdHandles);
        }
        public void TestCheckAutoMode()
        {
            IConfigManager cm = new XmlConfigManager(Resources.TestDirectory, Resources.ConfigFile);

            foreach (string cmd in Resources.ImageCmdHandles)
            {
                Assert.IsTrue(cm.CheckAutoMode(cmd) == AutoMode.AUTO || cm.CheckAutoMode(cmd) == AutoMode.MANUAL);
            }
        }
        public void Init()
        {
            string filename = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
                                           ApplicationConfig.Filename);

            ApplicationConfig appConfig = new XmlConfigManager <ApplicationConfig>().ReadConfigFromFile(filename);

            _instance = appConfig;
        }
        public BattleCryPlugin()
        {
            var dllLocation = Helper.GetPluginDllLocation();

            _soundFileDir = dllLocation + "\\AudioFiles\\";
            var soundBoard      = new SoundBoard(_soundFileDir);
            var configManager   = new XmlConfigManager();
            var cardSoundPicker = new ConfigCardSoundPicker(configManager, _soundFileDir + "cardsoundconfig.xml");
            var playHandler     = new PlayHandler(soundBoard, cardSoundPicker);

            _gameMonitor = new GameMonitor(playHandler);
        }
Beispiel #6
0
        static Framework()
        {
            //CultureInfo = CultureInfo.CurrentCulture;
            CultureInfo = null;

            ConfigurationManager = new ConfigurationManagerAdapter();
            //ConfigurationManager = new LuxConfigurationManager(new ConfigurationManagerAdapter());

            ConfigManager = new XmlConfigManager();
            TypeInstantiator = new TypeInstantiator();
            Asserter = new EmptyAsserter();
            LogFactory = new NullObjectLogFactory();

#if DEBUG
            LogFactory = new DebugLogFactory();
#endif
        }
Beispiel #7
0
        public void Setup()
        {
            IConfigManager configManager = new XmlConfigManager(Resources.TestDirectory, Resources.ConfigFile);

            backup = new XmlIndexBackup(configManager);

            tagLinks.Add(tag1, new List <string>()
            {
                "1.png", "2.png", "3.jpg"
            });
            tagLinks.Add(tag2, new List <string>()
            {
                "4.png", "5.png"
            });
            seriesTags.Add(series, new HashSet <string>()
            {
                tag1, tag2
            });
        }
        public void TestGetSetByName()
        {
            IConfigManager cm          = new XmlConfigManager(Resources.TestDirectory, Resources.ConfigFile);
            string         elementName = "NumThreads";

            int numThreads = int.Parse(cm.GetItemByName(elementName));

            if (numThreads > 2)
            {
                numThreads /= 2;
            }
            else
            {
                numThreads *= 2;
            }

            cm.ChangeItemByName(elementName, numThreads.ToString());

            int newNumThreads = int.Parse(cm.GetItemByName(elementName));

            Assert.AreEqual(numThreads, newNumThreads);
        }
Beispiel #9
0
 internal EntityViewMetaFactory(XmlConfigManager xmlConfigMgr, CodeEVMReader codeEVMReader)
 {
     _xmlCfgMgr  = xmlConfigMgr;
     _codeReader = codeEVMReader;
 }
Beispiel #10
0
 public EntityViewMetaFactory(XmlConfigManager xmlConfigMgr) : this(xmlConfigMgr, new CodeEVMReader())
 {
 }
Beispiel #11
0
 internal AggtBlocksRepository(XmlConfigManager xmlConfigMgr)
 {
     this._xmlCfgMgr = xmlConfigMgr;
 }
Beispiel #12
0
 static UIModel()
 {
     _xmlConfigMgr = new XmlConfigManager();
     Reset();
 }
 internal EntityViewMetaFactory(XmlConfigManager xmlConfigMgr)
 {
     this._xmlCfgMgr = xmlConfigMgr;
 }