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); }
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>()); }
private void PushNewObject(IId inputObject) { DataApiClient.InsertAsync(inputObject, inputObject.Id).Wait(); }