Exemple #1
0
 private async Task <ICollection <GcDataObject <T1> > > GetObjectCollectionAsync <T1>(string urlPath, List <int> ids)
 {
     using (var repo = new GcDataRepository <T1>(_apiKey, _userEmail))
     {
         return(await repo.GetObjectCollectionAsync(urlPath, ids));
     }
 }
Exemple #2
0
        public void GetAllObjects_InvalidCredential()
        {
            _serviceObject = new GcDataRepository <GcProject>("123", _configData.Email);
            var allDataObject = _serviceObject.GetAll("projects");

            Assert.IsNotNull(allDataObject);
            Assert.AreEqual(allDataObject.Data, null);
        }
Exemple #3
0
        public void GetSingleObject_InvalidCredential()
        {
            _serviceObject = new GcDataRepository <GcProject>("123", "abc");
            var singleDataObject = _serviceObject.GetSingle($"projects/{_configData.ProjectId}");

            Assert.IsNotNull(singleDataObject);
            Assert.AreEqual(singleDataObject.Data, null);
        }
Exemple #4
0
        private async Task <ICollection <T1> > GetCollectionAsync <T1>(string urlPath)
        {
            using (var repo = new GcDataRepository <T1>(_apiKey, _userEmail))
            {
                var result = await repo.GetAllAsync(urlPath);

                return(result.Data);
            }
        }
Exemple #5
0
        /* Post methods for Items end. */
        private async Task <T1> GetSingleAsync <T1>(string urlPath)
        {
            using (var repo = new GcDataRepository <T1>(_apiKey, _userEmail))
            {
                var result = await repo.GetSingleAsync(urlPath);

                return(result.Data);
            }
        }
Exemple #6
0
        public void GetObjectCollection_InvalidCredential()
        {
            var projectIds = new List <int> {
                _configData.ProjectId
            };

            _serviceObject = new GcDataRepository <GcProject>("123", _configData.Email);
            var someDataObject = _serviceObject.GetObjectCollection("projects/", projectIds);

            Assert.IsNotNull(someDataObject);
            Assert.AreEqual(someDataObject.ToList()[0].Data, null);
            Assert.AreEqual(someDataObject.ToList().Count, 1);
        }
Exemple #7
0
        public GcConnectClient(string apiKey, string userEmail)
        {
            _meClient       = new GcDataRepository <GcMe>(apiKey, userEmail);
            _accountClient  = new GcDataRepository <GcAccount>(apiKey, userEmail);
            _projectClient  = new GcDataRepository <GcProject>(apiKey, userEmail);
            _statusClient   = new GcDataRepository <GcStatus>(apiKey, userEmail);
            _itemClient     = new GcDataRepository <GcItem>(apiKey, userEmail);
            _templateClient = new GcDataRepository <GcTemplate>(apiKey, userEmail);
            _fileClient     = new GcDataRepository <GcFile>(apiKey, userEmail);
            _postClient     = new GcDataRepository <string>(apiKey, userEmail);

            _apiKey    = apiKey;
            _userEmail = userEmail;
        }
Exemple #8
0
 public void InitializeTests()
 {
     _configData    = new GcTestConfigData();
     _serviceObject = new GcDataRepository <GcProject>(_configData.ApiKey, _configData.Email);
 }