Ejemplo n.º 1
0
 public void SetUpBeforeClass()
 {
     if (_isCommunitySetupDone)
     {
         HttpRequest request = new HttpRequest(null, "http://localhost", null);
         Hd4 objHd4 = new Hd4(request, "/hdCloudConfig.json");
         string directoryPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
         string filePath = directoryPath + "\\" + "communityTest.zip";
         _store = HdStore.Instance;
         _store.SetPath(directoryPath, true);
           objHd4.CommunityFetchArchive();
         _isCommunitySetupDone = false;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// This is the main constructor for the class HD4
        /// </summary>
        /// <param name="request">Curret Request Object</param>
        /// <param name="configuration">config can be an array of config options or a fully qualified path to an alternate config file.</param>
        public Hd4(HttpRequest request, dynamic configuration = null)
        {
            _request = request;
            if (configuration != null && configuration is IDictionary)
            {
                foreach (KeyValuePair<string, string> item in (Dictionary<string, string>)configuration)
                {
                    if (Config.ContainsKey(item.Key))
                    {
                        Config[item.Key] = item.Value;
                    }
                    else
                    {
                        Config.Add(item.Key, item.Value);
                    }
                }
            }
            else if (configuration != null && configuration is string && File.Exists(ApplicationRootDirectory + configuration))
            {
                AddConfigSettingFromFile(ApplicationRootDirectory + configuration);
            }
            else if (!File.Exists(ApplicationRootDirectory + _configFile))
            {
                throw new Exception("Error : Invalid config file and no config passed to constructor");
            }
            else
            {
                AddConfigSettingFromFile(ApplicationRootDirectory + _configFile);
            }

            _store = HdStore.Instance;
            _store.SetPath(Config["filesdir"], true);

            _cache = new HdCache();
            _device = new HdDevice();

            Setup();
        }
Ejemplo n.º 3
0
 public HdExtra()
     : base()
 {
     this._store = HdStore.Instance;
 }
Ejemplo n.º 4
0
 public void test57_tearDownAfterClass()
 {
     _store = HdStore.Instance;
     _store.Purge();
 }
Ejemplo n.º 5
0
 public HdDevice()
 {
     _store = HdStore.Instance;
     _extra = new HdExtra();
 }
Ejemplo n.º 6
0
 public void TestSetupData()
 {
     _store = HdStore.Instance;
     _objCache = new HdCache();
     if (_testData.Count == 0)
     {
         _testData.Add("roses", "red");
         _testData.Add("fish", "blue");
         _testData.Add("sugar", "sweet");
         _testData.Add("number", "4");
     }
 }