示例#1
0
 public static async Task AddToDataSet(DataApiClient dataApiClient, string dataSetId, string dataType, string id)
 {
     if (!await dataApiClient.ExistsAsync <DataSet>(dataSetId))
     {
         var dataSet = new DataSet(dataSetId);
         await dataApiClient.InsertAsync(dataSet, dataSetId);
     }
     var dataTag = new DataTag(
         new DataReference(dataType, id),
         dataSetId);
     await dataApiClient.InsertAsync(dataTag);
 }
示例#2
0
        public void SubmitRejectsDataWithInvalidAccessToken()
        {
            var noLoginDataApiClient = new DataApiClient(ApiSetup.ApiConfiguration)
            {
                LoginMethod = LoginMethod.JsonWebToken
            };
            var testObject = new UnitTestDataObject1();

            AssertStatusCode(
                () => noLoginDataApiClient.InsertAsync(testObject).Wait(),
                HttpStatusCode.Unauthorized);
        }
        public void InvalidCollectionNameThrowsException()
        {
            var dataApiClient = new DataApiClient(new ApiConfiguration("", 443));

            Assert.That(async() => await dataApiClient.InsertAsync("Invalid!", "{ 'Id' : '46431' }"), Throws.InstanceOf <ApiException>());
        }
示例#4
0
 private void PushNewObject(IId inputObject)
 {
     DataApiClient.InsertAsync(inputObject, inputObject.Id).Wait();
 }