Пример #1
0
        public void GetWatchedAsyncEmpty()
        {
            IWatchListProvider provider = GetProvider();

            IEnumerable <Person> buddies = provider.GetWatchedAsync("identity").Result;

            Assert.IsNotNull(buddies);
            CollectionAssert.IsEmpty(buddies);
        }
Пример #2
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);
        }
Пример #3
0
        public void RemoveAsync()
        {
            IWatchListProvider provider = GetProvider();

            provider.AddAsync(personA, personB).Wait();
            provider.AddAsync(personA, personC).Wait();

            provider.RemoveAsync(personA.Identity, personB.Identity).Wait();

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

            CollectionAssert.DoesNotContain(buddies, personB);
            CollectionAssert.Contains(buddies, personC);
        }
Пример #4
0
        public void ClearAsync()
        {
            IWatchListProvider provider = GetProvider();

            provider.AddAsync(personA, personB).Wait();
            provider.AddAsync(personA, personC).Wait();

            provider.ClearAsync(personA.Identity).Wait();

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

            Assert.IsNotNull(buddies);
            CollectionAssert.IsEmpty(buddies);
        }
Пример #5
0
        public void GetWatchedAsyncInvalid()
        {
            IWatchListProvider provider = GetProvider();

            Assert.Throws <ArgumentNullException> (() => provider.GetWatchedAsync(null));
        }