예제 #1
0
        public void AddRangeAsyncInvalid()
        {
            IWatchListProvider provider = GetProvider();

            Assert.Throws <ArgumentNullException> (() => provider.AddRangeAsync(null, Enumerable.Empty <Person>()));
            Assert.Throws <ArgumentNullException> (() => provider.AddRangeAsync(personA, null));
        }
예제 #2
0
        public void GetWatchers()
        {
            IWatchListProvider provider = GetProvider();

            provider.AddRangeAsync(personA, new[] { personB, personC }).Wait();
            provider.AddRangeAsync(personB, new[] { personA, personC }).Wait();

            IEnumerable <Person> watchers = provider.GetWatchersAsync(personC.Identity).Result;

            CollectionAssert.Contains(watchers, personA);
            CollectionAssert.Contains(watchers, personB);
        }
예제 #3
0
        public void AddRangeAsync()
        {
            IWatchListProvider provider = GetProvider();

            provider.AddRangeAsync(personA, new[] { personB, personC }).Wait();

            IEnumerable <Person> buddies = provider.GetWatchedAsync(personA.Identity).Result;

            CollectionAssert.Contains(buddies, personB);
            CollectionAssert.Contains(buddies, personC);
        }