public void DiscoveredDevice_IsExpired_ImmediatelyReportsTrueIfCacheLifetimeIsZero() { var discoveredDevice = new DiscoveredSsdpDevice(); discoveredDevice.AsAt = DateTimeOffset.Now; discoveredDevice.CacheLifetime = TimeSpan.Zero; Assert.IsTrue(discoveredDevice.IsExpired()); }
public void DiscoveredDevice_IsExpired_DoesNotImmediatelyReportTrue() { var discoveredDevice = new DiscoveredSsdpDevice(); discoveredDevice.AsAt = DateTimeOffset.Now; discoveredDevice.CacheLifetime = TimeSpan.FromSeconds(1); Assert.IsFalse(discoveredDevice.IsExpired()); }
public void DiscoveredDevice_IsExpired_ReportsTrueAfterCacheLifetimeExpires() { var discoveredDevice = new DiscoveredSsdpDevice(); discoveredDevice.AsAt = DateTimeOffset.Now; discoveredDevice.CacheLifetime = TimeSpan.FromMilliseconds(100); System.Threading.Thread.Sleep(500); Assert.IsTrue(discoveredDevice.IsExpired()); }