public void GetWatchedAsyncEmpty() { IWatchListProvider provider = GetProvider(); IEnumerable <Person> buddies = provider.GetWatchedAsync("identity").Result; Assert.IsNotNull(buddies); CollectionAssert.IsEmpty(buddies); }
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); }
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); }
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); }
public void GetWatchedAsyncInvalid() { IWatchListProvider provider = GetProvider(); Assert.Throws <ArgumentNullException> (() => provider.GetWatchedAsync(null)); }