public NumberLookupServiceTest(MockHttpClientFixture mockHttpClientFixture) : base(mockHttpClientFixture) { this.service = new NumberLookupService(); this.options = new NumberLookupRecordOptions() { Type = null }; this.cancellationToken = default(CancellationToken); }
public NumberLookupRecord Get() { NumberLookupRecord record = new NumberLookupRecord(); NumberLookupRecordOptions options = new NumberLookupRecordOptions { Type = "undefined" }; Console.WriteLine(JsonConvert.SerializeObject(options)); try { record = service.Get(phoneNumber, options); Console.WriteLine(JsonConvert.SerializeObject(record)); } catch (TelnyxException ex) { Console.WriteLine("exception"); Console.WriteLine(JsonConvert.SerializeObject(ex)); } return(record); }
public async Task <NumberLookupRecord> GetAsync() { NumberLookupRecord record = new NumberLookupRecord(); NumberLookupRecordOptions options = new NumberLookupRecordOptions { Type = "undefined" }; Console.WriteLine(JsonConvert.SerializeObject(options)); try { record = await service.GetAsync(phoneNumber, options, null, new CancellationToken()); Console.WriteLine(JsonConvert.SerializeObject(record)); } catch (TelnyxException ex) { Console.WriteLine("exception"); Console.WriteLine(JsonConvert.SerializeObject(ex)); } return(record); }