Exemplo n.º 1
0
        public void GetWatchedAsyncEmpty()
        {
            IWatchListProvider provider = GetProvider();

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

            Assert.IsNotNull(buddies);
            CollectionAssert.IsEmpty(buddies);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 5
0
        public void GetWatchedAsyncInvalid()
        {
            IWatchListProvider provider = GetProvider();

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