public void DeserializeTimeToLiveFromSeconds() { var cache = new ServiceCache("cache", TimeSpan.FromSeconds(60)); var json = JsonConvert.SerializeObject(cache); var result = JsonConvert.DeserializeObject <ServiceCache>(json); Assert.Equal(60, result.TimeToLive.TotalSeconds); }
public void DeserializeTimeToLiveFromSeconds() { var cache = new ServiceCache("cache", TimeSpan.FromSeconds(60)); var json = OpenStackNet.Serialize(cache); var result = OpenStackNet.Deserialize <ServiceCache>(json); Assert.Equal(60, result.TimeToLive.TotalSeconds); }
public void DeserializeTimeToLiveFromSeconds() { var cache = new ServiceCache("cache", TimeSpan.FromSeconds(60)); var json = OpenStackNet.Serialize(cache); var result = OpenStackNet.Deserialize<ServiceCache>(json); Assert.Equal(60, result.TimeToLive.TotalSeconds); }
public void SerializeTimeToLiveToSeconds() { var cache = new ServiceCache("cache", TimeSpan.FromSeconds(60)); var json = OpenStackNet.Serialize(cache); var result = JObject.Parse(json); Assert.Equal(60, result.Value<double>("ttl")); }
public void DeserializeTimeToLiveFromSeconds() { var cache = new ServiceCache("cache", TimeSpan.FromSeconds(60)); var json = JsonConvert.SerializeObject(cache); var result = JsonConvert.DeserializeObject<ServiceCache>(json); Assert.Equal(60, result.TimeToLive.TotalSeconds); }
public void DeserializeTimeToLiveFromSeconds() { var cache = new ServiceCache("cache", TimeSpan.FromSeconds(60)); var json = OpenStackNet.Configuration.FlurlHttpSettings.JsonSerializer.Serialize(cache); var result = OpenStackNet.Configuration.FlurlHttpSettings.JsonSerializer.Deserialize <ServiceCache>(json); Assert.Equal(60, result.TimeToLive.TotalSeconds); }
public void SerializeTimeToLiveToSeconds() { var cache = new ServiceCache("cache", TimeSpan.FromSeconds(60)); var json = JsonConvert.SerializeObject(cache); var result = JObject.Parse(json); Assert.Equal(60, result.Value <double>("ttl")); }
public void SerializeTimeToLiveToSeconds() { var cache = new ServiceCache("cache", TimeSpan.FromSeconds(60)); var json = OpenStackNet.Configuration.FlurlHttpSettings.JsonSerializer.Serialize(cache); var result = JObject.Parse(json); Assert.Equal(60, result.Value <double>("ttl")); }