public void SerializeAndDeserializeExpandAndExtraParams() { var options = new BaseOptions(); options.AddExpand("expand_me"); options.AddExtraParam("foo", "String!"); options.AddExtraParam("bar", 234L); var json = JsonConvert.SerializeObject(options); var deserialized = JsonConvert.DeserializeObject <BaseOptions>(json); Assert.Equal(options.Expand, deserialized.Expand); Assert.True(options.ExtraParams.Count == deserialized.ExtraParams.Count); Assert.All( deserialized.ExtraParams, kvp => Assert.Equal(options.ExtraParams[kvp.Key], deserialized.ExtraParams[kvp.Key])); }
public async Task GetNetworkPreferenceAsync() { var baseOptions = new BaseOptions(); baseOptions.AddExtraParam("include_ota_updates", "true"); var result = await this.service.GetNetworkPreferenceAsync(Id, baseOptions, this.requestOptions); Assert.NotNull(result); Assert.Equal(typeof(SimCardRecord), result.GetType()); }
public MobileOperatorNetworksPreferencesRecord GetNetworkPreference() { MobileOperatorNetworksPreferencesRecord result = new MobileOperatorNetworksPreferencesRecord(); try { var baseOptions = new BaseOptions(); baseOptions.AddExtraParam("include_ota_updates", "true"); result = service.GetNetworkPreference(id, baseOptions); Console.WriteLine(JsonConvert.SerializeObject(result)); } catch (TelnyxException ex) { Console.WriteLine("exception"); Console.WriteLine(JsonConvert.SerializeObject(ex)); } return(result); }
public SimCardRecord Get() { SimCardRecord result = new SimCardRecord(); try { var baseOptions = new BaseOptions(); baseOptions.AddExtraParam("include_sim_card_group", "true"); result = service.Get(id, null); Console.WriteLine(JsonConvert.SerializeObject(result)); } catch (TelnyxException ex) { Console.WriteLine("exception"); Console.WriteLine(JsonConvert.SerializeObject(ex)); } return(result); }