Esempio n. 1
0
		public void BigList()
		{
			var generator = new RandomPersonGenerator();
			var people = generator.Take(10000).ToArray();
            _source.AddRange(people);

			Console.WriteLine();
		}
        public void CountChangedShouldReflectContentsOfCacheInvokeUponeSubscription()
        {
            var generator = new RandomPersonGenerator();
            int? result = null;
            var subscription = _source.CountChanged
                .Subscribe(count => result = count);

            _source.AddOrUpdate(generator.Take(100));

            Assert.IsTrue(result.HasValue, "Count has not been invoked. Should start at zero");
            Assert.AreEqual(100, result.Value, "Count should be 100");
            subscription.Dispose();
        }