Пример #1
0
 /// <summary>
 /// Creates new Dexter instance
 /// </summary>   
 /// <param name="dexterPath">path to a dexter-executor.jar</param>
 /// <param name="configuration">Configuration</param>
 public Dexter(Configuration configuration)
 {
     this.configuration = configuration;
     if (configuration == null)
         throw new ArgumentNullException("configuration");
     if (!configuration.IsDexterFound)
         throw new FileNotFoundException("Cannot find dexter in specified path", configuration.DexterExecutorPath);
     configuration.Save();
 }
Пример #2
0
        public void TestSaveLoad()
        {
            Configuration config = new Configuration()
            {
                dexterHome = "TestPath"
            };

            string configPath = AppDomain.CurrentDomain.BaseDirectory + "../../TestData/test-config.json";

            config.Save(configPath);

            Configuration loadedConfig = Configuration.Load(configPath);

            Assert.AreEqual("TestPath", loadedConfig.dexterHome);
        }