示例#1
0
 public void Setup()
 {
     if (_session == null)
     {
         _session = new SynologySession(new AppSettingsClientConfig());
         _session.Login();
         _api = new SynologyApi(_session);
     }
 }
示例#2
0
        public ApiTests()
        {
            var executingAssembly = new FileInfo(Assembly.GetExecutingAssembly().FullName);

            _localTestFolderNoSlash = executingAssembly.DirectoryName + "\\TestFiles";
            _localTestImage         = _localTestFolderNoSlash + "\\image\\synologybox.jpg";
            _md5TestImage           = _localTestFolderNoSlash + "\\image\\md5test.jpg";
            _synoTestFolderNoSlash  = WebConfigurationManager.AppSettings.Get("Syno.TestFolder");
            if (string.IsNullOrWhiteSpace(_synoTestFolderNoSlash))
            {
                throw new ConfigurationErrorsException("No Syno.TestFolder in app config found or value is empty");
            }

            _session = new SynologySession(new AppSettingsClientConfig());
            _session.Login();
            _api = new SynologyApi(_session);
        }