public void TestCacheCancellationToken() { var source = new CancellationTokenSource(); var token = source.Token; var dependencies = new DependencyContainer(); Assert.DoesNotThrow(() => dependencies.CacheValue(token)); var retrieved = dependencies.GetValue <CancellationToken>(); source.Cancel(); Assert.IsTrue(token.IsCancellationRequested); Assert.IsTrue(retrieved.IsCancellationRequested); }