示例#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);
        }