Пример #1
0
        public void InvalidServerNameThrowsNoExceptionIfSuppressed()
        {
            var apiConfiguration = new ApiConfiguration("", 443);
            var dataApiClient    = new DataApiClient(apiConfiguration, ignoreSslNameMismatch: true);

            Assert.That(() => dataApiClient.ExistsAsync <Location>("someID"), Throws.Nothing);
        }
Пример #2
0
        public void ValiddServerNameThrowsNoException()
        {
            var apiConfiguration = new ApiConfiguration("", 443);
            var dataApiClient    = new DataApiClient(apiConfiguration);

            Assert.That(() => dataApiClient.ExistsAsync <Location>("someID"), Throws.Nothing);
        }
Пример #3
0
        public void InvalidServerNameThrowsExceptionIfNotSuppressed()
        {
            var apiConfiguration = new ApiConfiguration("", 443);
            var dataApiClient    = new DataApiClient(apiConfiguration);

            Assert.That(() => dataApiClient.ExistsAsync <Location>("someID"), Throws.TypeOf <HttpRequestException>());
        }
Пример #4
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);
 }